Files
vectorcraft/crates
dotCooCoo 7615aed3ee JavaScript: a .mjs script runs as an ECMAScript 2015 module
script.run, File > Scripts and Other Script... run a file ending in .mjs as a
module: strict code with import and export declarations at its top level.
parse_module reads the module grammar and its early errors, and
Realm::start_module and Realm::run_module load the module graph through the
host, link every import before any module runs, and run each module once,
after the modules it imports. Imports read the exporting binding each time;
a read before initialization is a ReferenceError and an assignment is a
TypeError. import * as ns gives a namespace object that is not extensible,
and Object.isSealed and Object.isFrozen on it throw a ReferenceError for an
export its module has not initialized.

Specifiers are ./ and ../ paths to .mjs and .js files, resolved against the
importing file and read only through the script's file scope, so a module
can import only from the script's folder and the folders below it. Bare
names, URLs and absolute paths are a SyntaxError that names the specifier.
Module files count against the #include limits: 64 files besides the
script, 16 imports deep. import and export stay syntax errors in .js and
.jsx scripts; import() is not read. script.listInstalled lists .mjs files.

The test262 runner also runs the module tests under language/module-code,
import and export, reading the fixture files they import from the suite.
2026-11-22 12:16:11 -08:00
..
2026-11-19 15:24:38 +07:00