1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Fix for Issue number 501 ...

This commit is contained in:
Jeremy Ashkenas 2010-07-14 09:40:07 -04:00
parent 2b3b03c3c6
commit 0337dc23c3
3 changed files with 13 additions and 2 deletions

View file

@ -173,7 +173,7 @@
while ((typeof (_d = (nx = this.tokens[i + j])) !== "undefined" && _d !== null) && include(IMPLICIT_END, nx[0])) {
j++;
}
if ((typeof nx !== "undefined" && nx !== null) && nx[0] === ',') {
if ((typeof nx !== "undefined" && nx !== null) && nx[0] === ',' && this.tokens[i + j - 1][0] === 'OUTDENT') {
if (tag === 'TERMINATOR') {
this.tokens.splice(i, 1);
}

View file

@ -139,7 +139,7 @@ exports.Rewriter: class Rewriter
return 1
if open and !token.generated and prev[0] isnt ',' and (!post or include(IMPLICIT_END, tag))
j: 1; j++ while (nx: @tokens[i + j])? and include(IMPLICIT_END, nx[0])
if nx? and nx[0] is ','
if nx? and nx[0] is ',' and @tokens[i + j - 1][0] is 'OUTDENT'
@tokens.splice(i, 1) if tag is 'TERMINATOR'
else
size: closeCalls(i)

View file

@ -179,6 +179,17 @@ result: sum(1
ok result is 3
# This is a crazy one.
x: (obj, func) -> func obj
ident: (x) -> x
result: x {one: ident 1}, (obj) ->
inner: ident(obj)
ident inner
ok result.one is 1
# Assignment to a Object.prototype-named variable should not leak to outer scope.
(->
constructor: 'word'