Fixed a small bug about flexible splats that occured when the leading array was a literal

This commit is contained in:
matehat
2010-03-18 00:08:05 -04:00
parent 79e4f30f69
commit 256525bfa2
2 changed files with 4 additions and 4 deletions

View File

@@ -375,9 +375,9 @@ exports.CallNode: class CallNode extends BaseNode
if not (arg instanceof SplatNode)
prev: args[i - 1]
if i is 1 and prev.substr(0, 1) is '[' and prev.substr(prev.length - 1, 1) is ']'
args[i - 1]: "${prev.substr(0, prev.length - 2)}, $code]"
args[i - 1]: "${prev.substr(0, prev.length - 1)}, $code]"
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(0, 9) is '.concat([' and prev.substr(prev.length - 2, 2) is '])'
args[i - 1]: "${prev.substr(0, prev.length - 2)}, $code])"
continue
else