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

Remove unnecessary temporary variables around inlines #709

Jand42 opened this Issue Jun 23, 2017 · 1 comment


None yet
1 participant

Jand42 commented Jun 23, 2017

Translation fix for #695 introduces unnecessary variables around inlined calls (withInline attribute or by WIG).
Previously ItemGet was treated to be strongly pure (not having side effect and not depend on execution order), this is wrong in the general case. But when having an inline like console.log($x), now optimizer sees console.log access as possibly side-affecting, so for correct execution order, introduces a temporary variable for $x which is not needed.
Fix: whenever an application on an item get is encountered in reading JS inlines, mark it as stongly pure. This is a good enough compromise for output shortness and correctness.

  • Optionally: add an extra optional bool parameter to Inline/Direct attributes to disable all assumptions about them whenever the inline needs to be applied in a very exact manner.

This comment has been minimized.

Show comment
Hide comment

Jand42 Jul 20, 2017


released in Zafir.


Jand42 commented Jul 20, 2017

released in Zafir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment