Skip to content

Commit

Permalink
Merge pull request #4585 from helixbass/iss4283_error_message_implici…
Browse files Browse the repository at this point in the history
…t_call

Fix #4283: error message for implicit call
  • Loading branch information
lydell committed Jun 26, 2017
2 parents 48c7deb + 8234ce2 commit b1b34d3
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
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
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 b1b34d3

Please sign in to comment.