mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
fixing off-by-one error in compile_splat_arguments
This commit is contained in:
parent
6fd7810d89
commit
884637468e
3 changed files with 6 additions and 2 deletions
|
@ -489,7 +489,7 @@
|
|||
args[i - 1] = '' + (prev.substr(0, prev.length - 2)) + ", " + code + "]";
|
||||
continue;
|
||||
} 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;
|
||||
} else {
|
||||
code = "[" + code + "]";
|
||||
|
|
|
@ -378,7 +378,7 @@ exports.CallNode: class CallNode extends BaseNode
|
|||
args[i - 1]: "${prev.substr(0, prev.length - 2)}, $code]"
|
||||
continue
|
||||
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
|
||||
else
|
||||
code: "[$code]"
|
||||
|
|
|
@ -45,6 +45,10 @@ ok bronze is "Mighty Mouse"
|
|||
ok last is "Michael Phelps"
|
||||
ok the_field.length is 8
|
||||
|
||||
medalists contenders..., 'Tim', 'Bob', 'Jim'
|
||||
ok last is 'Jim'
|
||||
|
||||
|
||||
obj: {
|
||||
name: 'bob'
|
||||
accessor: (args...) ->
|
||||
|
|
Loading…
Reference in a new issue