Conversation
a41a5e7 to
5e9bd48
Compare
When `-sEXPORT_ES6` is enabled, Closure Compiler compiles output in ES module mode (`--chunk_output_type ES_MODULES`), which enforces strict arity checks (`JSC_WRONG_ARGUMENT_COUNT`) and object property type checks (`JSC_TYPE_MISMATCH`) that are otherwise silently ignored in traditional global script mode. Give optional parameters default values (`= undefined` or appropriate defaults like `dontFollow = false`), initialize `nameTable: []` instead of `null`, and remove surplus arguments at call sites in `libsyscall.js` and `libnodefs.js`. Fixes: emscripten-core#27747
5e9bd48 to
dddb267
Compare
| return FS.lookup(parent, name); | ||
| }, | ||
| createNode(parent, name, mode, rdev) { | ||
| createNode(parent, name, mode, rdev = undefined) { |
There was a problem hiding this comment.
This increases code size, doesn't it? Or does it get optimized out somehow?
There was a problem hiding this comment.
I think overall this change is a slight codesize win. I think because closure can eliminate these
There was a problem hiding this comment.
I am impressed it can, I guess. Though this does increase non-closure size. I guess we care about that less, but do we measure it at least?
| 'nodefs_sockfs': (['-lnodefs.js', '-lsockfs.js'],), | ||
| }) | ||
| def test_closure_fs_es6(self, args): | ||
| # TODO: Delete this test once test_closure_full_js_library can run with |
There was a problem hiding this comment.
Should this be "replace this test with a better one, once we can" rather than "delete this test" - ?
| return FS.lookup(parent, name); | ||
| }, | ||
| createNode(parent, name, mode, rdev) { | ||
| createNode(parent, name, mode, rdev = undefined) { |
There was a problem hiding this comment.
I am impressed it can, I guess. Though this does increase non-closure size. I guess we care about that less, but do we measure it at least?
When
-sEXPORT_ES6is enabled, Closure Compiler compiles output in ES module mode (--chunk_output_type ES_MODULES), which enforces strict arity checks (JSC_WRONG_ARGUMENT_COUNT) and object property type checks (JSC_TYPE_MISMATCH) that are otherwise silently ignored in traditional global script mode.Give optional parameters default values (
= undefinedor appropriate defaults likedontFollow = false), initializenameTable: []instead ofnull, and remove surplus arguments at call sites inlibsyscall.jsandlibnodefs.js.See google/closure-compiler#4344
Fixes: #27747