From the JS Module Source section in github I understand that importing a JS module in the source phase should return a valid object with AbstractModuleSource.prototype in the prototype chain, but from the spec, I understand that it should throw. What is the expected behavior?
Here is how I'm reading the spec:
HTML's create a JavaScript module script calls TC39's Parse Module, which is not modified in the source phase import proposal, so it leaves the Abstract Module Record's new [[ModuleSource]] slot EMPTY. So that would throw in the Linking inside InitializeEnvironments when checking the imports and for dynamic imports in ContinueDynamicImport when finishing the import for the JS script.
From the JS Module Source section in github I understand that importing a JS module in the source phase should return a valid object with
AbstractModuleSource.prototypein the prototype chain, but from the spec, I understand that it should throw. What is the expected behavior?Here is how I'm reading the spec:
HTML's create a JavaScript module script calls TC39's Parse Module, which is not modified in the source phase import proposal, so it leaves the Abstract Module Record's new [[ModuleSource]] slot EMPTY. So that would throw in the Linking inside InitializeEnvironments when checking the imports and for dynamic imports in ContinueDynamicImport when finishing the import for the JS script.