You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// main.js
import {pi} from "./other.js";
export * as common from "./common.js";
// other.js
import {common} from "./main.js";
export var pi = 3.14;
// common.js
export var e = 2.718;
The linking of main.js leads to the violation of the assert at the begining of GetModuleNamespace(). In other words, GetModuleNamespace() is invoked with a module in unlinked state.
Note that InnerModuleLinking('main.js') invokes InnerModuleLinking('other.js') before InnerModuleLinking('common.js') (due to the order of statements in main.js). So, common.js remains in unlinked state during InnerModuleLinking('other.js').
FYI: This violation of the assert can be reproduced using engine262 easily:
$ node bin/engine262.js --module main.js
/somePath/dist/engine262.js:29106
throw new AssertError(source);
^
AssertError: module.Status !== 'new' && module.Status !== 'unlinked'
at Assert (/somePath/dist/engine262.js:29106:13)
at GetModuleNamespace (/somePath/dist/engine262.js:29044:7)
at ManagedSourceTextModuleRecord.InitializeEnvironment (/somePath/dist/engine262.js:21004:31)
at InnerModuleLinking (/somePath/dist/engine262.js:28690:25)
at InnerModuleLinking (/somePath/dist/engine262.js:28672:20)
at ManagedSourceTextModuleRecord.Link (/somePath/dist/engine262.js:20678:22)
at /somePath/bin/engine262.js:159:27
at ManagedRealm.scope (/somePath/dist/engine262.js:56724:17)
at oneShotEval (/somePath/bin/engine262.js:143:9)
at Object.<anonymous> (/somePath/bin/engine262.js:183:3)
Node.js v18.14.1
The text was updated successfully, but these errors were encountered:
Consider the following modules:
The linking of
main.js
leads to the violation of the assert at the begining ofGetModuleNamespace()
. In other words,GetModuleNamespace()
is invoked with a module inunlinked
state.The relevant operations are
Note that
InnerModuleLinking('main.js')
invokesInnerModuleLinking('other.js')
beforeInnerModuleLinking('common.js')
(due to the order of statements inmain.js
). So,common.js
remains inunlinked
state duringInnerModuleLinking('other.js')
.FYI: This violation of the assert can be reproduced using
engine262
easily:The text was updated successfully, but these errors were encountered: