-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: module is not a reserved JS keyword
- Loading branch information
Showing
9 changed files
with
145 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...babel-parser/test/fixtures/experimental/import-reflection/invalid-module-escape/input.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import modul\u0065 foo from "./module.wasm"; |
3 changes: 3 additions & 0 deletions
3
...el-parser/test/fixtures/experimental/import-reflection/invalid-module-escape/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"throws": "Unexpected token, expected \"from\" (1:19)" | ||
} |
1 change: 1 addition & 0 deletions
1
...res/experimental/import-reflection/valid-from-as-default-module-binding-escaped/input.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import module \u0066rom from "./module.wasm"; |
38 changes: 38 additions & 0 deletions
38
...s/experimental/import-reflection/valid-from-as-default-module-binding-escaped/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":45,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":45,"index":45}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":45,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":45,"index":45}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ImportDeclaration", | ||
"start":0,"end":45,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":45,"index":45}}, | ||
"specifiers": [ | ||
{ | ||
"type": "ImportDefaultSpecifier", | ||
"start":14,"end":23,"loc":{"start":{"line":1,"column":14,"index":14},"end":{"line":1,"column":23,"index":23}}, | ||
"local": { | ||
"type": "Identifier", | ||
"start":14,"end":23,"loc":{"start":{"line":1,"column":14,"index":14},"end":{"line":1,"column":23,"index":23},"identifierName":"from"}, | ||
"name": "from" | ||
} | ||
} | ||
], | ||
"module": true, | ||
"source": { | ||
"type": "StringLiteral", | ||
"start":29,"end":44,"loc":{"start":{"line":1,"column":29,"index":29},"end":{"line":1,"column":44,"index":44}}, | ||
"extra": { | ||
"rawValue": "./module.wasm", | ||
"raw": "\"./module.wasm\"" | ||
}, | ||
"value": "./module.wasm" | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...st/fixtures/experimental/import-reflection/valid-from-as-default-module-binding/input.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import module from from "./module.wasm"; |
38 changes: 38 additions & 0 deletions
38
.../fixtures/experimental/import-reflection/valid-from-as-default-module-binding/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":40,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":40,"index":40}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":40,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":40,"index":40}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ImportDeclaration", | ||
"start":0,"end":40,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":40,"index":40}}, | ||
"specifiers": [ | ||
{ | ||
"type": "ImportDefaultSpecifier", | ||
"start":14,"end":18,"loc":{"start":{"line":1,"column":14,"index":14},"end":{"line":1,"column":18,"index":18}}, | ||
"local": { | ||
"type": "Identifier", | ||
"start":14,"end":18,"loc":{"start":{"line":1,"column":14,"index":14},"end":{"line":1,"column":18,"index":18},"identifierName":"from"}, | ||
"name": "from" | ||
} | ||
} | ||
], | ||
"module": true, | ||
"source": { | ||
"type": "StringLiteral", | ||
"start":24,"end":39,"loc":{"start":{"line":1,"column":24,"index":24},"end":{"line":1,"column":39,"index":39}}, | ||
"extra": { | ||
"rawValue": "./module.wasm", | ||
"raw": "\"./module.wasm\"" | ||
}, | ||
"value": "./module.wasm" | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...er/test/fixtures/experimental/import-reflection/valid-module-as-default-binding/input.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import module from "./module.wasm"; |
38 changes: 38 additions & 0 deletions
38
.../test/fixtures/experimental/import-reflection/valid-module-as-default-binding/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":35,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":35,"index":35}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":35,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":35,"index":35}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ImportDeclaration", | ||
"start":0,"end":35,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":35,"index":35}}, | ||
"specifiers": [ | ||
{ | ||
"type": "ImportDefaultSpecifier", | ||
"start":7,"end":13,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":13,"index":13}}, | ||
"local": { | ||
"type": "Identifier", | ||
"start":7,"end":13,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":13,"index":13},"identifierName":"module"}, | ||
"name": "module" | ||
} | ||
} | ||
], | ||
"module": false, | ||
"source": { | ||
"type": "StringLiteral", | ||
"start":19,"end":34,"loc":{"start":{"line":1,"column":19,"index":19},"end":{"line":1,"column":34,"index":34}}, | ||
"extra": { | ||
"rawValue": "./module.wasm", | ||
"raw": "\"./module.wasm\"" | ||
}, | ||
"value": "./module.wasm" | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |