How are modules imported from a ScriptBody without System?

# Isiah Meadows (10 years ago)

Without the System loader, it is no longer clear to me from within the spec how modules are supposed to be imported within normal scripts (e.g. in web pages).

Formerly, this was done via System.import().

Also, this removal seems to have left quite a bit of spec equivalent to dead code, along with a few other inconsistencies, most notably a distinct disconnect between loading a ModuleBody and a ScriptBody, with no apparent way for a ScriptBody to load a ModuleBody. This concerns me a little.

# Domenic Denicola (10 years ago)

The situation that modules are in now is equivalent to the situation scripts are in. That is, the way that they are loaded, executed, parsed, embedded in other languages, etc. is not specified by the ECMAScript language specification, and is left for other specifications.

For the case of scripts, the answers to this are found in the HTML Standard. For modules, the corresponding spec has not yet been written.

# Allen Wirfs-Brock (10 years ago)

On Dec 8, 2014, at 8:23 AM, Isiah Meadows wrote:

Also, this removal seems to have left quite a bit of spec equivalent to dead code,

Can you identify specific instances in the latest draft? In theory, I've already eliminated all such dead code. If you can identify stuff I've missed I'll get rid of it.

# Isiah Meadows (10 years ago)

@Allen I did find a few cases of obvious dead spec code, notably %Loader%, %LoaderPrototype%, and %LoaderIteratorPrototype%. I'll file bugs as I find more. ([link to this bug](

@Domenic I didn't realize that the module loading was intended to be spec'd out elsewhere.

# Isiah Meadows (10 years ago)

Forgot to link the bug... :(

Here it is: ecmascript#3421

Also, I filed this: ecmascript#3422