assertIsImportDeclaration("import source from './module.js'");
assertIsImportDeclaration("import source, { mod } from './module.js'");
assertIsImportSourceDeclaration("import source source from './module.js'");
assertIsImportSourceDeclaration("import source from from './module.js'");
assertIsImportSourceDeclaration(`import
source
mod
from './module.js'`);
// Check that `source` is defined properly
assertThrowsInstanceOf(() => Reflect.parse("import source source from './module.js'; let source = 2;", {target: "module"}), SyntaxError);
// Error outside of module context
assertThrowsInstanceOf(() => Reflect.parse("import source mod from './module.js'"), SyntaxError);
assertThrowsInstanceOf(() => Reflect.parse("import source source source from './module.js'", {target: "module"}), SyntaxError);
assertThrowsInstanceOf(() => Reflect.parse("import source source from from './module.js'", {target: "module"}), SyntaxError);
assertThrowsInstanceOf(() => Reflect.parse("import source from from from './module.js'", {target: "module"}), SyntaxError);
assertThrowsInstanceOf(() => Reflect.parse("import source await from './module.js'", {target: "module"}), SyntaxError);
assertThrowsInstanceOf(() => Reflect.parse("import source yield from './module.js'", {target: "module"}), SyntaxError);
assertThrowsInstanceOf(() => Reflect.parse("import source from", {target: "module"}), SyntaxError);
assertThrowsInstanceOf(() => Reflect.parse("import source from 42", {target: "module"}), SyntaxError);
assertThrowsInstanceOf(() => Reflect.parse("import source mod from 'module.js' with { type: 'json' }", {target: "module"}), SyntaxError);
assertErrorMessage(() => Reflect.parse("import source * from './module.js'", {target: "module"}), SyntaxError, "missing declaration after 'import source'");
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.