Allow any reserved word in export {} from specifiers (#9616)
This commit is contained in:
1
packages/babel-parser/test/fixtures/es2015/modules/export-from-valid-reserved-word/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/es2015/modules/export-from-valid-reserved-word/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { if } from 'foo'
|
||||
122
packages/babel-parser/test/fixtures/es2015/modules/export-from-valid-reserved-word/output.json
vendored
Normal file
122
packages/babel-parser/test/fixtures/es2015/modules/export-from-valid-reserved-word/output.json
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 0,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 9,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "if"
|
||||
},
|
||||
"name": "if"
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "if"
|
||||
},
|
||||
"name": "if"
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"type": "StringLiteral",
|
||||
"start": 19,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": "foo",
|
||||
"raw": "'foo'"
|
||||
},
|
||||
"value": "foo"
|
||||
},
|
||||
"declaration": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:17)"
|
||||
}
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token, expected \";\" (1:17)"
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:16)"
|
||||
}
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected keyword 'default' (1:8)"
|
||||
}
|
||||
Reference in New Issue
Block a user