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

Replace for..in with for..of to save 6 bytes #53

Merged
merged 1 commit into from
Aug 2, 2016
Merged

Conversation

sigvef
Copy link
Contributor

@sigvef sigvef commented Jul 28, 2016

This replaces the for..in-loop in the unpacking bootstrapper with a
for..of loop. This shaves 6 bytes off of the total packed output.

The for..of loop is supported by all current major browsers: Chrome
since version 51, Firefox since version 13, Edge since version 12,
Safari since version 7.1, Chrome for Android since version 38 and Safari
Mobile since version 8.

This replaces the for..in-loop in the unpacking bootstrapper with a
for..of loop. This shaves 6 bytes off of the total packed output.

The for..of loop is supported by all current major browsers: Chrome
since version 51, Firefox since version 13, Edge since version 12,
Safari since version 7.1, Chrome for Android since version 38 and Safari
Mobile since version 8.
@Siorki
Copy link
Owner

Siorki commented Jul 30, 2016

Interesting new feature from ES6, thanks for sharing it. Now that most browsers support it, ES6 will most likely be allowed in js1k 2017 (for the record, it wasn't in 2016).

I am a bit worried with the lack of support from IE 11 though. Same goes with arrow functions so I am considering adding "Use ES6 capabilities" as an option (checked by default).

@sigvef
Copy link
Contributor Author

sigvef commented Jul 30, 2016

Putting ES6 usage behind an opt-out option flag sounds like a good idea. Should I add it to this pull request?

@Siorki
Copy link
Owner

Siorki commented Aug 2, 2016

No, thanks. I'll merge the PR first, then add the flag later as part as the refactor that is due for v5.

@Siorki Siorki merged commit f9f364c into Siorki:master Aug 2, 2016
Siorki added a commit that referenced this pull request Oct 14, 2016
Encapsulation of #53 in unpacking routine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants