Allow any reserved word in export {} from specifiers (#9616)

This commit is contained in:
Daniel Tschinder
2019-02-28 15:07:20 -08:00
committed by GitHub
parent f13f4adcbb
commit 17f4195bcc
5 changed files with 139 additions and 15 deletions

View File

@@ -0,0 +1 @@
export { if } from 'foo'

View 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": []
}
}

View File

@@ -1,3 +1,4 @@
{
"throws": "Unexpected token (1:17)"
}
"sourceType": "module",
"throws": "Unexpected token, expected \";\" (1:17)"
}

View File

@@ -1,3 +1,4 @@
{
"throws": "Unexpected token (1:16)"
}
"sourceType": "module",
"throws": "Unexpected keyword 'default' (1:8)"
}