Skip to content

Commit

Permalink
error message for implicit call [Fixes #4283]
Browse files Browse the repository at this point in the history
  • Loading branch information
helixbass committed Jun 25, 2017
1 parent 48c7deb commit 8234ce2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/coffee-script/rewriter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/rewriter.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ exports.Rewriter = class Rewriter
startImplicitCall = (j) ->
idx = j ? i
stack.push ['(', idx, ours: yes]
tokens.splice idx, 0, generate 'CALL_START', '('
tokens.splice idx, 0, generate 'CALL_START', '(', ['', 'implicit function call', token[2]]
i += 1 if not j?

endImplicitCall = ->
Expand Down
9 changes: 9 additions & 0 deletions test/error_messages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1319,3 +1319,12 @@ test "#4248: Unicode code point escapes", ->
'\\u{a}\\u{1111110000}'
\ ^\^^^^^^^^^^^^^
'''

test "#4283: error message for implicit call", ->
assertErrorFormat '''
console.log {search, users, contacts users_to_display}
''', '''
[stdin]:1:29: error: unexpected implicit function call
console.log {search, users, contacts users_to_display}
^^^^^^^^
'''

0 comments on commit 8234ce2

Please sign in to comment.