WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
255396
Unexpected 'var' resolution in module
https://bugs.webkit.org/show_bug.cgi?id=255396
Summary
Unexpected 'var' resolution in module
Tzvetelin Vassilev
Reported
2023-04-13 07:56:39 PDT
Problem is observed with emscripten build. Generated Module looks in this way: // Module.mjs var Module = (() => { var _scriptDir = import.meta.url; return ( async function(Module = {}) { console.log(Module) // result is null, expected value is data var Module = typeof Module != "undefined" ? Module : {}; console.log(Module) // result is {} // emscripten stuff } ); })(); export default Module; After import like this: // index.mjs let factory = (await import("Module.mjs")).default await Module({/* data */}) Something is got wrong and Module value is lost.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-04-20 07:57:21 PDT
<
rdar://problem/108318013
>
Yusuke Suzuki
Comment 2
2023-04-20 09:23:26 PDT
That's correct behavior. module's global scope is Module lexical environment. Not global scope.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug