-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Bug of compile (1, eval) #1793
Comments
Any updates? |
Could you explain the issue a bit further? Since the comma operator only returns the last item and |
@adrianheine you can create one JS file and then try both look what is difference |
This looks like a transformation used by a transpiler like Babel. We had similar issues with |
@rwu823 Now I understand. I only checked in the nodejs REPL where both behave the same. |
I wonder if this case could be added as a special exception, as it is a known pattern? |
I agree. The question is only how specific this fix should be as I have been considering for some time to create a more general solution for these kinds of issues as they will become more prevalent once we start simplifying resolvable conditional expressions. (true ? eval : ()=>{})('this');
(true && eval)('this') and of course any chain of these constructs. With #1949, I plan on introducing a new context-specific render parameter that could be extended to signal a node that it is inside a call expression where it was previously wrapped in some context-shielding construct. Then if a member expression or an identifier (to solve this issue) encounters this flag, it could automatically wrap itself into e.g. a |
Indirect call cases are all properly handled now thanks to some careful work by @lukastaegert. |
input:
output:
The text was updated successfully, but these errors were encountered: