Skip to content

Invalid JS: Splatted statement causes if block inside array element #1349

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

Closed
satyr opened this issue May 11, 2011 · 2 comments
Closed

Invalid JS: Splatted statement causes if block inside array element #1349

satyr opened this issue May 11, 2011 · 2 comments
Labels

Comments

@satyr
Copy link
Collaborator

satyr commented May 11, 2011

$ coffee -bpe '[a if b...]'
var __slice = Array.prototype.slice;
__slice.call(  if (b) {
    a;
  });

$ coffee -e '[a if b...]'

.:3
  __slice.call(    if (b) {
                   ^^
SyntaxError: Unexpected token if
@jashkenas jashkenas removed this from the as soon as a patch is available milestone Jun 2, 2015
@GeoffreyBooth GeoffreyBooth changed the title splatted statement Invalid JS: Splatted statement causes if block inside array element May 5, 2017
@GeoffreyBooth
Copy link
Collaborator

Either a duplicate or else very closely related to #4260.

GeoffreyBooth added a commit to GeoffreyBooth/coffeescript that referenced this issue Aug 23, 2017
zdenko pushed a commit to GeoffreyBooth/coffeescript that referenced this issue Aug 23, 2017
GeoffreyBooth pushed a commit that referenced this issue Aug 27, 2017
…sions (#4644)

* fix splat error with soak properties or expressions

* Add test based on #4260

* Add test based on #1349

* tests for the leading splat variant

* test for spaced prefix ...

* fixed 'if' statement in parens

* fixed replacing 'void 0' with '[]'

* remove 'void 0' replacement; add Splat::compileNode

* Use LEVEL_OP; follow style better
@GeoffreyBooth
Copy link
Collaborator

Fixed by #4644.

GeoffreyBooth pushed a commit that referenced this issue Aug 27, 2017
…sions (#4643)

* fix splat error with soak properties or expressions

* Add test based on #4260

* Add test based on #1349

* remove 'void 0' replacement; add Splat::compileNode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants