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

[CS2] Lexer/Nodes: Expansion that becomes rest parameter causes runtime error #4631

Closed
Inve1951 opened this issue Aug 5, 2017 · 3 comments
Closed
Labels
Milestone

Comments

@Inve1951
Copy link
Contributor

Inve1951 commented Aug 5, 2017

copy pasting from actual code

header = header[(6 + header.lastIndexOf "/\/ME"+"TA") ... header.lastIndexOf "*/\/"]  # BD EOL bug workaround

used to compile to: (cs2-beta3)

header = header.slice(6 + header.lastIndexOf("/\/ME" + "TA"), header.lastIndexOf("*/\/"));

output with beta4:

header = header[(6 + header.lastIndexOf("/\/ME" + "TA"))(...header.lastIndexOf("*/\/"))];

now throws at runtime: TypeError: (var)[Symbol.iterator] is not a function(…)
also the supposed comment is missing in the js

@GeoffreyBooth GeoffreyBooth changed the title [CS2] new ...splats causing runtime errors [CS2] Lexer/Nodes: Expansion that becomes rest parameter causes runtime error Aug 5, 2017
@GeoffreyBooth
Copy link
Collaborator

@zdenko do you mind taking a look at this?

@zdenko
Copy link
Collaborator

zdenko commented Aug 5, 2017

@GeoffreyBooth sure.

@GeoffreyBooth GeoffreyBooth modified the milestone: 2.0.0 Aug 14, 2017
GeoffreyBooth pushed a commit that referenced this issue Aug 17, 2017
… error (#4634)

* expansion-rest bug fix

* tests; improved implicit call recognition with dots on the left in the `rewriter`

* whitespace cleanup

* more tests
@GeoffreyBooth
Copy link
Collaborator

Fixed by #4634.

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