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

IIFE inlining #1

Open
michaelficarra opened this issue Dec 22, 2017 · 0 comments
Open

IIFE inlining #1

michaelficarra opened this issue Dec 22, 2017 · 0 comments

Comments

@michaelficarra
Copy link
Member

(function(){
  something();
  something();
})();

to

something();
something();

as long as the function

  • does not refer to this or arguments (or new.target or super, I guess?)
  • has no arguments
  • does not contain a return - if it does, replace the return with evaluating the expression and a break? or just don't worry about it
  • does not contain any conflicting variable declarations (which I guess means not doing this to IIFEs which are not contained in outer functions when the IIFE has a declaration).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant