[CS1] fix #4260 and #1349: splat error with soak properties or expressions#4643
Merged
GeoffreyBooth merged 4 commits intoAug 27, 2017
Merged
Conversation
e8ae1e9 to
fb21fbe
Compare
Collaborator
|
See #4644. I’m not sure this bug is severe enough that it’s worth fixing in 1.x. Since the current output throws runtime errors, this bug doesn’t cause any bugs in anyone’s code; it’s just that some syntax that should be allowable just isn’t, until #4644 gets merged in. Or to look at it another way, we add support for this syntax in CoffeeScript 2 😄 |
Collaborator
Author
|
@GeoffreyBooth // [a?.b...]
slice.call((typeof a !== "undefined" && a !== null ? a.b : []));I'll take a look. |
Collaborator
Author
|
@GeoffreyBooth I think this should be fixed now. |
connec
approved these changes
Aug 27, 2017
|
|
||
| compileToFragments: (o) -> | ||
| compileNode: (o) -> | ||
| @name.compileToFragments o |
Collaborator
There was a problem hiding this comment.
Should this get LEVEL_OP too?
Collaborator
There was a problem hiding this comment.
In this case no, since in CS1 splats are not operators, but are instead handled by Arr and Assign.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a fix for #4260 and #1349 when invalid JS is compiled if
Splatcontains soak accessor (?.), orifstatement.Before:
After: