Skip to content

Commit f199a61

Browse files
blackmiaoolhzoo
authored andcommitted
fix the error info of 'sourceType' (babel#572)
1 parent c7292a7 commit f199a61

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/parser/statement.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pp.parseStatement = function (declaration, topLevel) {
105105
}
106106

107107
if (!this.inModule) {
108-
this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'");
108+
this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: \"module\"'");
109109
}
110110
}
111111
return starttype === tt._import ? this.parseImport(node) : this.parseExport(node);
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"throws": "'import' and 'export' may appear only with 'sourceType: module' (1:0)"
2+
"throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)"
33
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"throws": "'import' and 'export' may appear only with 'sourceType: module' (1:0)"
2+
"throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)"
33
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"throws": "'import' and 'export' may appear only with 'sourceType: module' (1:0)"
2+
"throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)"
33
}

0 commit comments

Comments
 (0)