Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error message when defer slot is a function call #203

Open
wants to merge 6 commits into
base: iced2
Choose a base branch
from

Conversation

zapu
Copy link
Collaborator

@zapu zapu commented May 5, 2018

This turned out to be an evening project to make the tests pass again on latest node and npm.

PR fixes compilation error during await foo defer err result, which because of lack of comma is compiled as await foo(defer(err(result))) and err(result) is not valid slot. It's so not valid that it even crashes compiler.

 » echo "await func defer err foo" | iced -cpbs
TypeError: a.icedToSlot is not a function
  at /usr/local/lib/node_modules/iced-coffee-script/lib/coffee-script/nodes.js:3196:27
  at new Defer (/usr/local/lib/node_modules/iced-coffee-script/lib/coffee-script/nodes.js:3199:9)
  at Object.anonymous (/usr/local/lib/node_modules/iced-coffee-script/lib/coffee-script/parser.js:312:58)
  at Parser.parse (/usr/local/lib/node_modules/iced-coffee-script/lib/coffee-script/parser.js:690:36)

 » echo "await func defer err foo" | ./bin/coffee -cpbs
[stdin]:1:18: error: function call cannot be a slot for defer
await func defer err foo
                 ^^^^^^^

zapu added 4 commits May 5, 2018 20:02
It was still pulled because it's a sub-depedency, but the way it was
installed by latest npm made it impossible to require directly from
coffee-script package.
Copy link
Owner

@maxtaco maxtaco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! 👍

@zapu
Copy link
Collaborator Author

zapu commented May 11, 2018

I think you need to hit merge as well. Thanks!

@zapu
Copy link
Collaborator Author

zapu commented May 11, 2018

ah, but I didn't touch the version string anywhere. please hold

@zapu
Copy link
Collaborator Author

zapu commented May 12, 2018

Done! Bumped version and recompiled browser bundle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants