-
-
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.
Update
finishCallExpression
and avoid type cast
- Loading branch information
1 parent
8534573
commit aeabbd9
Showing
15 changed files
with
499 additions
and
32 deletions.
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
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
4 changes: 2 additions & 2 deletions
4
...babel-parser/test/fixtures/experimental/_no-plugin/import-assertions-dynamic/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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"throws": "This experimental syntax requires enabling the parser plugin: \"importAssertions\". (1:24)", | ||
"sourceType": "module", | ||
"plugins": [] | ||
"plugins": [], | ||
"throws": "This experimental syntax requires enabling the parser plugin: \"importAttributes\". (1:24)" | ||
} |
3 changes: 0 additions & 3 deletions
3
...l/import-attributes-deprecatedAssertKeyword/dynamic-import-with-valid-syntax/options.json
This file was deleted.
Oops, something went wrong.
81 changes: 81 additions & 0 deletions
81
...al/import-attributes-deprecatedAssertKeyword/dynamic-import-with-valid-syntax/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,81 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":48,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":48,"index":48}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":48,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":48,"index":48}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":48,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":48,"index":48}}, | ||
"expression": { | ||
"type": "CallExpression", | ||
"start":0,"end":48,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":48,"index":48}}, | ||
"callee": { | ||
"type": "Import", | ||
"start":0,"end":6,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":6,"index":6}} | ||
}, | ||
"arguments": [ | ||
{ | ||
"type": "StringLiteral", | ||
"start":7,"end":17,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":17,"index":17}}, | ||
"extra": { | ||
"rawValue": "foo.json", | ||
"raw": "\"foo.json\"" | ||
}, | ||
"value": "foo.json" | ||
}, | ||
{ | ||
"type": "ObjectExpression", | ||
"start":19,"end":47,"loc":{"start":{"line":1,"column":19,"index":19},"end":{"line":1,"column":47,"index":47}}, | ||
"properties": [ | ||
{ | ||
"type": "ObjectProperty", | ||
"start":21,"end":45,"loc":{"start":{"line":1,"column":21,"index":21},"end":{"line":1,"column":45,"index":45}}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":21,"end":27,"loc":{"start":{"line":1,"column":21,"index":21},"end":{"line":1,"column":27,"index":27},"identifierName":"assert"}, | ||
"name": "assert" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "ObjectExpression", | ||
"start":29,"end":45,"loc":{"start":{"line":1,"column":29,"index":29},"end":{"line":1,"column":45,"index":45}}, | ||
"properties": [ | ||
{ | ||
"type": "ObjectProperty", | ||
"start":31,"end":43,"loc":{"start":{"line":1,"column":31,"index":31},"end":{"line":1,"column":43,"index":43}}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":31,"end":35,"loc":{"start":{"line":1,"column":31,"index":31},"end":{"line":1,"column":35,"index":35},"identifierName":"type"}, | ||
"name": "type" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "StringLiteral", | ||
"start":37,"end":43,"loc":{"start":{"line":1,"column":37,"index":37},"end":{"line":1,"column":43,"index":43}}, | ||
"extra": { | ||
"rawValue": "json", | ||
"raw": "\"json\"" | ||
}, | ||
"value": "json" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
...import-attributes-deprecatedAssertKeyword/invalid-spread-element-import-call/options.json
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
.../import-attributes-deprecatedAssertKeyword/invalid-spread-element-import-call/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,48 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":28,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":28,"index":28}}, | ||
"errors": [ | ||
"SyntaxError: `...` is not allowed in `import()`. (1:21)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":28,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":28,"index":28}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":28,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":28,"index":28}}, | ||
"expression": { | ||
"type": "CallExpression", | ||
"start":0,"end":27,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":27,"index":27}}, | ||
"callee": { | ||
"type": "Import", | ||
"start":0,"end":6,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":6,"index":6}} | ||
}, | ||
"arguments": [ | ||
{ | ||
"type": "StringLiteral", | ||
"start":7,"end":19,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":19,"index":19}}, | ||
"extra": { | ||
"rawValue": "./foo.json", | ||
"raw": "\"./foo.json\"" | ||
}, | ||
"value": "./foo.json" | ||
}, | ||
{ | ||
"type": "SpreadElement", | ||
"start":21,"end":26,"loc":{"start":{"line":1,"column":21,"index":21},"end":{"line":1,"column":26,"index":26}}, | ||
"argument": { | ||
"type": "ArrayExpression", | ||
"start":24,"end":26,"loc":{"start":{"line":1,"column":24,"index":24},"end":{"line":1,"column":26,"index":26}}, | ||
"elements": [] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
...xperimental/import-attributes-deprecatedAssertKeyword/trailing-comma-dynamic/options.json
This file was deleted.
Oops, something went wrong.
114 changes: 114 additions & 0 deletions
114
...experimental/import-attributes-deprecatedAssertKeyword/trailing-comma-dynamic/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,114 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":69,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":50,"index":69}}, | ||
"errors": [ | ||
"SyntaxError: Trailing comma is disallowed inside import(...) arguments. (1:15)", | ||
"SyntaxError: Trailing comma is disallowed inside import(...) arguments. (2:47)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":69,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":2,"column":50,"index":69}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":18,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":18,"index":18}}, | ||
"expression": { | ||
"type": "CallExpression", | ||
"start":0,"end":17,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":17,"index":17}}, | ||
"callee": { | ||
"type": "Import", | ||
"start":0,"end":6,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":6,"index":6}} | ||
}, | ||
"extra": { | ||
"trailingComma": 15 | ||
}, | ||
"arguments": [ | ||
{ | ||
"type": "StringLiteral", | ||
"start":7,"end":15,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":15,"index":15}}, | ||
"extra": { | ||
"rawValue": "foo.js", | ||
"raw": "\"foo.js\"" | ||
}, | ||
"value": "foo.js" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":19,"end":69,"loc":{"start":{"line":2,"column":0,"index":19},"end":{"line":2,"column":50,"index":69}}, | ||
"expression": { | ||
"type": "CallExpression", | ||
"start":19,"end":68,"loc":{"start":{"line":2,"column":0,"index":19},"end":{"line":2,"column":49,"index":68}}, | ||
"callee": { | ||
"type": "Import", | ||
"start":19,"end":25,"loc":{"start":{"line":2,"column":0,"index":19},"end":{"line":2,"column":6,"index":25}} | ||
}, | ||
"extra": { | ||
"trailingComma": 66 | ||
}, | ||
"arguments": [ | ||
{ | ||
"type": "StringLiteral", | ||
"start":26,"end":36,"loc":{"start":{"line":2,"column":7,"index":26},"end":{"line":2,"column":17,"index":36}}, | ||
"extra": { | ||
"rawValue": "foo.json", | ||
"raw": "\"foo.json\"" | ||
}, | ||
"value": "foo.json" | ||
}, | ||
{ | ||
"type": "ObjectExpression", | ||
"start":38,"end":66,"loc":{"start":{"line":2,"column":19,"index":38},"end":{"line":2,"column":47,"index":66}}, | ||
"properties": [ | ||
{ | ||
"type": "ObjectProperty", | ||
"start":40,"end":64,"loc":{"start":{"line":2,"column":21,"index":40},"end":{"line":2,"column":45,"index":64}}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":40,"end":46,"loc":{"start":{"line":2,"column":21,"index":40},"end":{"line":2,"column":27,"index":46},"identifierName":"assert"}, | ||
"name": "assert" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "ObjectExpression", | ||
"start":48,"end":64,"loc":{"start":{"line":2,"column":29,"index":48},"end":{"line":2,"column":45,"index":64}}, | ||
"properties": [ | ||
{ | ||
"type": "ObjectProperty", | ||
"start":50,"end":62,"loc":{"start":{"line":2,"column":31,"index":50},"end":{"line":2,"column":43,"index":62}}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":50,"end":54,"loc":{"start":{"line":2,"column":31,"index":50},"end":{"line":2,"column":35,"index":54},"identifierName":"type"}, | ||
"name": "type" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "StringLiteral", | ||
"start":56,"end":62,"loc":{"start":{"line":2,"column":37,"index":56},"end":{"line":2,"column":43,"index":62}}, | ||
"extra": { | ||
"rawValue": "json", | ||
"raw": "\"json\"" | ||
}, | ||
"value": "json" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
...est/fixtures/experimental/import-attributes/dynamic-import-with-valid-syntax/options.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.