mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 19:34:27 -05:00
Fixed a tiny slicing bug
This commit is contained in:
@@ -486,7 +486,7 @@
|
|||||||
if (!(arg instanceof SplatNode)) {
|
if (!(arg instanceof SplatNode)) {
|
||||||
prev = args[i - 1];
|
prev = args[i - 1];
|
||||||
if (i === 1 && prev[0] === '[' && prev[prev.length - 1] === ']') {
|
if (i === 1 && prev[0] === '[' && prev[prev.length - 1] === ']') {
|
||||||
args[i - 1] = '' + (prev.slice(0, prev.length - 2)) + ", " + code + "]";
|
args[i - 1] = '' + (prev.slice(0, prev.length - 1)) + ", " + code + "]";
|
||||||
continue;
|
continue;
|
||||||
} else if (i > 1 && prev[8] === '[' && prev[prev.length - 2] === ']') {
|
} else if (i > 1 && prev[8] === '[' && prev[prev.length - 2] === ']') {
|
||||||
args[i - 1] = '' + (prev.slice(0, prev.length - 2)) + ", " + code + "])";
|
args[i - 1] = '' + (prev.slice(0, prev.length - 2)) + ", " + code + "])";
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ exports.CallNode: class CallNode extends BaseNode
|
|||||||
if not (arg instanceof SplatNode)
|
if not (arg instanceof SplatNode)
|
||||||
prev: args[i - 1]
|
prev: args[i - 1]
|
||||||
if i is 1 and prev[0] is '[' and prev[prev.length - 1] is ']'
|
if i is 1 and prev[0] is '[' and prev[prev.length - 1] is ']'
|
||||||
args[i - 1] = "${prev[0...prev.length - 2]}, $code]"
|
args[i - 1] = "${prev[0...prev.length - 1]}, $code]"
|
||||||
continue
|
continue
|
||||||
else if i > 1 and prev[8] is '[' and prev[prev.length - 2] is ']'
|
else if i > 1 and prev[8] is '[' and prev[prev.length - 2] is ']'
|
||||||
args[i - 1] = "${prev[0...prev.length - 2]}, $code])"
|
args[i - 1] = "${prev[0...prev.length - 2]}, $code])"
|
||||||
|
|||||||
Reference in New Issue
Block a user