program([
importDeclaration(
[
importSpecifier(
ident("default"),
ident("d")
),
importSpecifier(
ident("a"),
ident("b")
)
],
moduleRequest(
lit("c"),
[]
)
)
]).assert(parseAsModule("import d, { a as b } from 'c'"));
program([
importDeclaration(
[
importSpecifier(
ident("default"),
ident("d")
),
importSpecifier(
ident("a"),
ident("a")
),
importSpecifier(
ident("b"),
ident("b")
),
],
moduleRequest(
lit("c"),
[]
)
)
]).assert(parseAsModule("import d, { a, b } from 'c'"));
program([
importDeclaration(
[
importSpecifier(
ident("default"),
ident("d")
),
importSpecifier(
ident("a"),
ident("b")
),
importSpecifier(
ident("c"),
ident("f")
),
],
moduleRequest(
lit("e"),
[]
)
)
]).assert(parseAsModule("import d, { a as b, c as f } from 'e'"));
program([
importDeclaration(
[
importSpecifier(
ident("true"),
ident("a")
)
],
moduleRequest(
lit("b"),
[]
)
)
]).assert(parseAsModule("import { true as a } from 'b'"));
program([
importDeclaration(
[
importSpecifier(
ident("a"),
ident("a")
),
importSpecifier(
ident("b"),
ident("b")
),
],
moduleRequest(
lit("c"),
[]
)
)
]).assert(parseAsModule("import { a, b } from 'c'"));
program([
importDeclaration(
[
importSpecifier(
ident("a"),
ident("b")
),
importSpecifier(
ident("c"),
ident("d")
),
],
moduleRequest(
lit("e"),
[]
)
)
]).assert(parseAsModule("import { a as b, c as d } from 'e'"));
assertThrowsInstanceOf(function() {
parseAsModule("import a, b from 'a'");
}, SyntaxError);
assertThrowsInstanceOf(function() {
parseAsModule("import * as a,");
}, SyntaxError);
assertThrowsInstanceOf(function() {
parseAsModule("import * as a, {} from 'a'");
}, SyntaxError);
assertThrowsInstanceOf(function() {
parseAsModule("import as a from 'a'");
}, SyntaxError);
assertThrowsInstanceOf(function() {
parseAsModule("import * a from 'a'");
}, SyntaxError);
assertThrowsInstanceOf(function() {
parseAsModule("import * as from 'a'");
}, SyntaxError);
assertThrowsInstanceOf(function() {
parseAsModule("import , {} from 'a'");
}, SyntaxError);
assertThrowsInstanceOf(function() {
parseAsModule("import d, from 'a'");
}, SyntaxError);
assertThrowsInstanceOf(function() {
parseAsModule("import * as true from 'b'");
}, SyntaxError);
Messung V0.5
¤ 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.0.11Bemerkung:
(vorverarbeitet)
¤
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.