mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
fixing implicit-call-in-function-in-parens bug.
This commit is contained in:
parent
8317960f81
commit
df97effb9c
3 changed files with 11 additions and 2 deletions
|
@ -162,7 +162,7 @@
|
|||
stack[stack.length - 1] += last;
|
||||
}
|
||||
open = stack[stack.length - 1] > 0;
|
||||
if (!(typeof post !== "undefined" && post !== null) || (start_parens > parens) || (parens === 0 && include(IMPLICIT_END, tag))) {
|
||||
if (!(typeof post !== "undefined" && post !== null) || (start_parens > parens) || (start_parens === parens && include(IMPLICIT_END, tag))) {
|
||||
if (tag === 'INDENT' && prev && include(IMPLICIT_BLOCK, prev[0])) {
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ exports.Rewriter: class Rewriter
|
|||
last: stack.pop()
|
||||
stack[stack.length - 1]: + last
|
||||
open: stack[stack.length - 1] > 0
|
||||
if !post? or (start_parens > parens) or (parens is 0 and include IMPLICIT_END, tag)
|
||||
if !post? or (start_parens > parens) or (start_parens is parens and include IMPLICIT_END, tag)
|
||||
return 1 if tag is 'INDENT' and prev and include IMPLICIT_BLOCK, prev[0]
|
||||
return 1 if tag is 'OUTDENT' and token.generated
|
||||
if open or tag is 'INDENT'
|
||||
|
|
|
@ -129,3 +129,12 @@ result: (f 1).toString()
|
|||
.length
|
||||
|
||||
ok result is 1
|
||||
|
||||
|
||||
# Test implicit calls in functions in parens:
|
||||
result: ((val) ->
|
||||
[].push val
|
||||
val
|
||||
)(10)
|
||||
|
||||
ok result is 10
|
||||
|
|
Loading…
Add table
Reference in a new issue