-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Slice literal assignment #13
Comments
Very nice idea. Splice literal to go with the slice literal. It can't be a "return", but I think we can do it with the JS comma operator.
|
Sounds good. |
Splice literals are now on master. Your first example:
Compiles to:
You can use inclusive or exclusive ranges, as usual. We actually don't need to worry about the return value, because splices modify the array in place, and it's an AssignNode that's doing the compilation, suppressing the actual, y'know, assignment. Closing the ticket. |
…placed before variable declarations
…on-top-ast-node Set file number on top AST node
This is following advice found in this comment: microsoft/TypeScript#8305 (comment)
The following code
Compiles to
I suggest it should compile to:
The main problem with this approach is simply that the return value of that expression is what is removed not the new array, which would fit better with assignment semantics, hence the return statement.
The text was updated successfully, but these errors were encountered: