-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Initial usage of ES6 in JS library code #15765
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
Conversation
3c9d594 to
bd2e5c6
Compare
a791242 to
f16903e
Compare
=>) in JS library code
tlively
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
| f = re.sub(r'\s*function\s*\(Module\)\s*{\s*Module\s*=\s*Module\s*\|\|\s*{\s*}\s*;\s*var\s+(\w+)\s*=\s*Module\s*;', r'function(\1){', f) | ||
|
|
||
| # Same as above but for arrow function | ||
| f = re.sub(r'\s*\(Module\)\s*=>\s*{\s*Module\s*=\s*Module\s*\|\|\s*{\s*}\s*;\s*var\s+(\w+)\s*=\s*Module\s*;', r'(\1)=>{', f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test that exercises this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, without this there is a test that fails... i don't remember which one I'm afraid.
Now that ES6 features are permitted in emscripten JS library code (see emscripten-core#15763) we can take advantage of some of them to reduce size of our output JS. This is just an initial test of using ES6 features. See: emscripten-core#11984
Now that ES6 features are permitted in emscripten JS library
code (see #15763) we can take advantage of some of them to
reduce size of our output JS.
This is just an initial test of using ES6 features.
See: #11984