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:
parent
2b3b03c3c6
commit
0337dc23c3
3 changed files with 13 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Add table
Reference in a new issue