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

0.toFixed [1]... #1011

Closed
satyr opened this issue Jan 3, 2011 · 5 comments
Closed

0.toFixed [1]... #1011

satyr opened this issue Jan 3, 2011 · 5 comments

Comments

@satyr
Copy link
Collaborator

satyr commented Jan 3, 2011

$ coffee -e '0.toFixed [1]...'

...:2
  0.toFixed.apply(0, [1]);
  ^^
SyntaxError: Unexpected token ILLEGAL
...
@michaelficarra
Copy link
Collaborator

So this occurs whenever passing a splat to a number. Looks like a problem with lines 531 and/or 537 of nodes.coffee. Should be an easy fix. I'll get on it tonight if I have time.

@michaelficarra
Copy link
Collaborator

I notice we keep having issues like this, and I can't help but feel that it's due to us compiling to strings too early, rather than simply creating a branch to replace the node being parsed in our AST. For example, instead of returning a string at the end of compileSplat, it should build up a mini-tree of a call being performed on the reference, then return the result of calling compile on that. I hope I wrote that in an understandable way. I think this would solve so many of our problems. Thoughts, anyone?

@StanAngeloff
Copy link
Contributor

Couldn't agree more and I've thought about it sooo many times. All generated code should happen through nodes and anything that remains should be there for a damn good reason.

@michaelficarra
Copy link
Collaborator

Fixed here: #1021

@jashkenas
Copy link
Owner

Thanks, michael -- merged to master.

geraldalewis pushed a commit to geraldalewis/coffee-script that referenced this issue May 2, 2011
geraldalewis pushed a commit to geraldalewis/coffee-script that referenced this issue May 2, 2011
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants