fixing off-by-one error in compile_splat_arguments
This commit is contained in:
parent
6fd7810d89
commit
884637468e
|
@ -489,7 +489,7 @@
|
||||||
args[i - 1] = '' + (prev.substr(0, prev.length - 2)) + ", " + code + "]";
|
args[i - 1] = '' + (prev.substr(0, prev.length - 2)) + ", " + code + "]";
|
||||||
continue;
|
continue;
|
||||||
} else if (i > 1 && prev.substr(8, 1) === '[' && prev.substr(prev.length - 2, 1) === ']') {
|
} else if (i > 1 && prev.substr(8, 1) === '[' && prev.substr(prev.length - 2, 1) === ']') {
|
||||||
args[i - 1] = '' + (prev.substr(0, prev.length - 3)) + ", " + code + "])";
|
args[i - 1] = '' + (prev.substr(0, prev.length - 2)) + ", " + code + "])";
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
code = "[" + code + "]";
|
code = "[" + code + "]";
|
||||||
|
|
|
@ -378,7 +378,7 @@ exports.CallNode: class CallNode extends BaseNode
|
||||||
args[i - 1]: "${prev.substr(0, prev.length - 2)}, $code]"
|
args[i - 1]: "${prev.substr(0, prev.length - 2)}, $code]"
|
||||||
continue
|
continue
|
||||||
else if i > 1 and prev.substr(8, 1) is '[' and prev.substr(prev.length - 2, 1) is ']'
|
else if i > 1 and prev.substr(8, 1) is '[' and prev.substr(prev.length - 2, 1) is ']'
|
||||||
args[i - 1]: "${prev.substr(0, prev.length - 3)}, $code])"
|
args[i - 1]: "${prev.substr(0, prev.length - 2)}, $code])"
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
code: "[$code]"
|
code: "[$code]"
|
||||||
|
|
|
@ -45,6 +45,10 @@ ok bronze is "Mighty Mouse"
|
||||||
ok last is "Michael Phelps"
|
ok last is "Michael Phelps"
|
||||||
ok the_field.length is 8
|
ok the_field.length is 8
|
||||||
|
|
||||||
|
medalists contenders..., 'Tim', 'Bob', 'Jim'
|
||||||
|
ok last is 'Jim'
|
||||||
|
|
||||||
|
|
||||||
obj: {
|
obj: {
|
||||||
name: 'bob'
|
name: 'bob'
|
||||||
accessor: (args...) ->
|
accessor: (args...) ->
|
||||||
|
|
Loading…
Reference in New Issue