Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd3b9357

Browse files
nknappjaylinski
authored andcommitted
refactor: rename i to startPartIndex
1 parent99d162c commitd3b9357

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

‎lib/handlebars/compiler/javascript-compiler.js‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -534,16 +534,22 @@ JavaScriptCompiler.prototype = {
534534
this.resolvePath('data',parts,0,true,strict);
535535
},
536536

537-
resolvePath:function(type,parts,i,falsy,strict){
537+
resolvePath:function(type,parts,startPartIndex,falsy,strict){
538538
if(this.options.strict||this.options.assumeObjects){
539539
this.push(
540-
strictLookup(this.options.strict&&strict,this,parts,i,type)
540+
strictLookup(
541+
this.options.strict&&strict,
542+
this,
543+
parts,
544+
startPartIndex,
545+
type
546+
)
541547
);
542548
return;
543549
}
544550

545551
letlen=parts.length;
546-
for(;i<len;i++){
552+
for(leti=startPartIndex;i<len;i++){
547553
/* eslint-disable no-loop-func */
548554
this.replaceStack((current)=>{
549555
letlookup=this.nameLookup(current,parts[i],type);
@@ -1155,14 +1161,14 @@ JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
11551161
);
11561162
};
11571163

1158-
functionstrictLookup(requireTerminal,compiler,parts,i,type){
1164+
functionstrictLookup(requireTerminal,compiler,parts,startPartIndex,type){
11591165
letstack=compiler.popStack(),
11601166
len=parts.length;
11611167
if(requireTerminal){
11621168
len--;
11631169
}
11641170

1165-
for(;i<len;i++){
1171+
for(leti=startPartIndex;i<len;i++){
11661172
stack=compiler.nameLookup(stack,parts[i],type);
11671173
}
11681174

@@ -1172,7 +1178,7 @@ function strictLookup(requireTerminal, compiler, parts, i, type) {
11721178
'(',
11731179
stack,
11741180
', ',
1175-
compiler.quotedString(parts[i]),
1181+
compiler.quotedString(parts[len]),
11761182
', ',
11771183
JSON.stringify(compiler.source.currentLocation),
11781184
' )',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp