Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[parser] Enable "exportNamespaceFrom" by default (#10521)
- Loading branch information
1 parent
d248e2d
commit 4cd93ab
Showing
22 changed files
with
263 additions
and
27 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/es2020/export-ns-from/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 @@ | ||
{ | ||
"sourceType": "module" | ||
} |
4 changes: 0 additions & 4 deletions
4
packages/babel-parser/test/fixtures/experimental/_no-plugin/export-namespace/options.json
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ges/babel-parser/test/fixtures/experimental/export-extensions/default-and-ns/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,4 +1,4 @@ | ||
{ | ||
"plugins": ["exportDefaultFrom", "exportNamespaceFrom"], | ||
"plugins": ["exportDefaultFrom"], | ||
"sourceType": "module" | ||
} |
4 changes: 0 additions & 4 deletions
4
packages/babel-parser/test/fixtures/experimental/export-extensions/ns-and-named/options.json
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/babel-parser/test/fixtures/experimental/export-extensions/ns-default/options.json
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/babel-parser/test/fixtures/experimental/export-extensions/ns/input.js
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/babel-parser/test/fixtures/experimental/export-extensions/ns/options.json
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/babel-parser/test/fixtures/flow/declare-export/export-star-as/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,3 +1,3 @@ | ||
{ | ||
"plugins": ["jsx", "flow", "exportNamespaceFrom"] | ||
"plugins": ["jsx", "flow"] | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/babel-parser/test/fixtures/flow/type-exports/star-as-from/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 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["flow", "exportNamespaceFrom"], | ||
"plugins": ["flow"], | ||
"throws": "Unexpected token (1:14)" | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/babel-parser/test/fixtures/placeholders/export/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,4 +1,4 @@ | ||
{ | ||
"plugins": ["placeholders", "exportDefaultFrom", "exportNamespaceFrom"], | ||
"plugins": ["placeholders", "exportDefaultFrom"], | ||
"sourceType": "module" | ||
} |
3 changes: 1 addition & 2 deletions
3
packages/babel-parser/test/fixtures/placeholders/export/star-from-2/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,4 @@ | ||
{ | ||
"plugins": ["placeholders"], | ||
"sourceType": "module", | ||
"throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)" | ||
"sourceType": "module" | ||
} |
120 changes: 120 additions & 0 deletions
120
packages/babel-parser/test/fixtures/placeholders/export/star-from-2/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,120 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33 | ||
} | ||
}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExportNamedDeclaration", | ||
"start": 0, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33 | ||
} | ||
}, | ||
"specifiers": [ | ||
{ | ||
"type": "ExportNamespaceSpecifier", | ||
"start": 7, | ||
"end": 20, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20 | ||
} | ||
}, | ||
"exported": { | ||
"type": "Placeholder", | ||
"start": 12, | ||
"end": 20, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20 | ||
} | ||
}, | ||
"name": { | ||
"type": "Identifier", | ||
"start": 14, | ||
"end": 18, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 18 | ||
}, | ||
"identifierName": "STAR" | ||
}, | ||
"name": "STAR" | ||
}, | ||
"expectedNode": "Identifier" | ||
} | ||
} | ||
], | ||
"source": { | ||
"type": "StringLiteral", | ||
"start": 26, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 26 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 32 | ||
} | ||
}, | ||
"extra": { | ||
"rawValue": "file", | ||
"raw": "\"file\"" | ||
}, | ||
"value": "file" | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
packages/babel-parser/test/fixtures/placeholders/export/star-from-3/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,4 @@ | ||
{ | ||
"plugins": ["placeholders"], | ||
"sourceType": "module", | ||
"throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)" | ||
"sourceType": "module" | ||
} |
133 changes: 133 additions & 0 deletions
133
packages/babel-parser/test/fixtures/placeholders/export/star-from-3/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,133 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 35, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 35 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 35, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 35 | ||
} | ||
}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExportNamedDeclaration", | ||
"start": 0, | ||
"end": 35, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 35 | ||
} | ||
}, | ||
"specifiers": [ | ||
{ | ||
"type": "ExportNamespaceSpecifier", | ||
"start": 7, | ||
"end": 20, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20 | ||
} | ||
}, | ||
"exported": { | ||
"type": "Placeholder", | ||
"start": 12, | ||
"end": 20, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20 | ||
} | ||
}, | ||
"name": { | ||
"type": "Identifier", | ||
"start": 14, | ||
"end": 18, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 18 | ||
}, | ||
"identifierName": "STAR" | ||
}, | ||
"name": "STAR" | ||
}, | ||
"expectedNode": "Identifier" | ||
} | ||
} | ||
], | ||
"source": { | ||
"type": "Placeholder", | ||
"start": 26, | ||
"end": 34, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 26 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 34 | ||
} | ||
}, | ||
"name": { | ||
"type": "Identifier", | ||
"start": 28, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 28 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 32 | ||
}, | ||
"identifierName": "FILE" | ||
}, | ||
"name": "FILE" | ||
}, | ||
"expectedNode": "StringLiteral" | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
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