File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,15 @@ function isExportedByForceFilesystem(name) {
5656 * their build, or no symbols that no longer exist.
5757 */
5858function hookGlobalSymbolAccess ( sym , func ) {
59+ #if MODULARIZE && ! EXPORT_ES6
60+ // In MODULARIZE mode the generated code runs inside a function scope and not
61+ // the global scope, and JavaScript does not provide access to function scopes
62+ // so we cannot dynamically modify the scrope using `defineProperty` in this
63+ // case.
64+ //
65+ // In this mode we simply ignore requests for `hookGlobalSymbolAccess`. Since
66+ // this is a debug-only feature, skipping it is not major issue.
67+ #else
5968 if ( typeof globalThis != 'undefined' && ! Object . getOwnPropertyDescriptor ( globalThis , sym ) ) {
6069 Object . defineProperty ( globalThis , sym , {
6170 configurable : true ,
@@ -65,6 +74,7 @@ function hookGlobalSymbolAccess(sym, func) {
6574 }
6675 } ) ;
6776 }
77+ #endif
6878}
6979
7080function missingGlobal ( sym , msg ) {
You can’t perform that action at this time.
0 commit comments