Use the string "module" in err message (#598)
This commit is contained in:
parent
03b3b39b17
commit
f7547fd35a
@ -662,7 +662,7 @@ export default class ExpressionParser extends LValParser {
|
||||
const id = this.parseIdentifier(true);
|
||||
this.expect(tt.dot);
|
||||
if (!this.inModule) {
|
||||
this.raise(id.start, "import.meta may appear only with 'sourceType: module'");
|
||||
this.raise(id.start, `import.meta may appear only with 'sourceType: "module"'`);
|
||||
}
|
||||
return this.parseMetaProperty(node, id, "meta");
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
}
|
||||
|
||||
if (!this.inModule) {
|
||||
this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'");
|
||||
this.raise(this.state.start, `'import' and 'export' may appear only with 'sourceType: "module"'`);
|
||||
}
|
||||
}
|
||||
return starttype === tt._import ? this.parseImport(node) : this.parseExport(node);
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "'import' and 'export' may appear only with 'sourceType: module' (1:0)"
|
||||
"throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)"
|
||||
}
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "'import' and 'export' may appear only with 'sourceType: module' (1:0)"
|
||||
"throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)"
|
||||
}
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "'import' and 'export' may appear only with 'sourceType: module' (1:0)"
|
||||
"throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)"
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"throws": "import.meta may appear only with 'sourceType: module' (1:10)",
|
||||
"throws": "import.meta may appear only with 'sourceType: \"module\"' (1:10)",
|
||||
"plugins": ["dynamicImport", "importMeta"],
|
||||
"sourceType": "script"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user