Repository navigation
[JS] Fix Closure compiler arity and type warnings with -sEXPORT_ES6 - #28100
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces significant updates to the library files to improve ES6 compatibility and default parameter handling, including the transition to ES6 module output in tests. A critical issue was identified in src/lib/libglemu.js where initializing materialShininess to an empty array [] changes its truthiness and could lead to runtime errors; the reviewer suggests using a safe default value like [0.0] instead.
sbc100
force-pushed
the
fix-closure-all-es6
branch
from
October 29, 2026 17:40
341d848 to
5566eaa
Compare
kripken
reviewed
Oct 29, 2026
kripken
reviewed
Oct 29, 2026
sbc100
force-pushed
the
fix-closure-all-es6
branch
4 times, most recently
from
October 30, 2026 18:45
21f6cb7 to
8e5c14b
Compare
sbc100
force-pushed
the
fix-closure-all-es6
branch
from
October 30, 2026 18:49
8e5c14b to
a717583
Compare
kripken
approved these changes
Oct 30, 2026
Followup to emscripten-core#27749. Make all remaining JS libraries compatible with Closure compiler in ES6 module mode (`-sEXPORT_ES6`). - Change loop variables in `$miniTempWebGLFloatBuffers__postset` and `$miniTempWebGLIntBuffers__postset` from `var` to `let` to prevent duplicate top-level `var` declaration collisions in ES module scope. - Remove duplicate forward `var` declarations in `$GLEmulation__postset` and `fogColor: null` initializer on `$GLEmulation`. - Provide default values for optional arguments across `libbrowser.js`, `libfs_shared.js`, `libglemu.js`, `libglfw.js`, `libhtml5.js`, `liblz4.js`, `libopenal.js`, `libproxyfs.js`, `libsdl.js`, `libwasmfs.js`, and `libworkerfs.js`. - Remove unused parameter from `GLImmediate.createRenderer`. - Remove undefined `SDL.music.source` reference in `libsdl.js`. - Update `test_closure_full_js_library` to run with `-sEXPORT_ES6` and remove temporary `test_closure_fs_es6`. See: emscripten-core#27747
sbc100
force-pushed
the
fix-closure-all-es6
branch
from
October 30, 2026 20:37
a717583 to
ae0c9ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Followup to #27749.
Make all remaining JS libraries compatible with Closure compiler in
ES6 module mode (
-sEXPORT_ES6).$miniTempWebGLFloatBuffers__postsetand$miniTempWebGLIntBuffers__postsetfromvartoletto preventduplicate top-level
vardeclaration collisions in ES module scope.vardeclarations in$GLEmulation__postsetandfogColor: nullinitializer on$GLEmulation.libbrowser.js,libfs_shared.js,libglemu.js,libglfw.js,libhtml5.js,liblz4.js,libopenal.js,libproxyfs.js,libsdl.js,libwasmfs.js, andlibworkerfs.js.GLImmediate.createRenderer.SDL.music.sourcereference inlibsdl.js.test_closure_full_js_libraryto run with-sEXPORT_ES6andremove temporary
test_closure_fs_es6.See: #27747