Throw error when exporting non-declaration (#241)
* Throw error when exporting non-declaration fixes #238 * Do check ahead of parsing export statement
This commit is contained in:
parent
5630380026
commit
5fb4353778
@ -848,7 +848,7 @@ pp.parseExport = function (node) {
|
||||
if (needsSemi) this.semicolon();
|
||||
this.checkExport(node, true, true);
|
||||
return this.finishNode(node, "ExportDefaultDeclaration");
|
||||
} else if (this.state.type.keyword || this.shouldParseExportDeclaration()) {
|
||||
} else if (this.shouldParseExportDeclaration()) {
|
||||
node.specifiers = [];
|
||||
node.source = null;
|
||||
node.declaration = this.parseExportDeclaration(node);
|
||||
@ -901,8 +901,13 @@ pp.parseExportFrom = function (node, expect?) {
|
||||
this.semicolon();
|
||||
};
|
||||
|
||||
pp.shouldParseExportDeclaration = function () {
|
||||
return this.isContextual("async");
|
||||
pp.shouldParseExportDeclaration = function (): boolean {
|
||||
return this.state.type.keyword === "var"
|
||||
|| this.state.type.keyword === "const"
|
||||
|| this.state.type.keyword === "let"
|
||||
|| this.state.type.keyword === "function"
|
||||
|| this.state.type.keyword === "class"
|
||||
|| this.isContextual("async");
|
||||
};
|
||||
|
||||
pp.checkExport = function (node, checkNames, isDefault) {
|
||||
|
||||
1
test/fixtures/es2015/uncategorised/380/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/380/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export var foo = 1;
|
||||
121
test/fixtures/es2015/uncategorised/380/expected.json
vendored
Normal file
121
test/fixtures/es2015/uncategorised/380/expected.json
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"specifiers": [],
|
||||
"source": null,
|
||||
"declaration": {
|
||||
"type": "VariableDeclaration",
|
||||
"start": 7,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 11,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 11,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"init": {
|
||||
"type": "NumericLiteral",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
test/fixtures/es2015/uncategorised/380/options.json
vendored
Normal file
3
test/fixtures/es2015/uncategorised/380/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceType": "module"
|
||||
}
|
||||
1
test/fixtures/es2015/uncategorised/381/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/381/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export const foo = 1;
|
||||
121
test/fixtures/es2015/uncategorised/381/expected.json
vendored
Normal file
121
test/fixtures/es2015/uncategorised/381/expected.json
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 0,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"specifiers": [],
|
||||
"source": null,
|
||||
"declaration": {
|
||||
"type": "VariableDeclaration",
|
||||
"start": 7,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 13,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"init": {
|
||||
"type": "NumericLiteral",
|
||||
"start": 19,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "const"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
test/fixtures/es2015/uncategorised/381/options.json
vendored
Normal file
3
test/fixtures/es2015/uncategorised/381/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceType": "module"
|
||||
}
|
||||
1
test/fixtures/es2015/uncategorised/382/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/382/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export let foo = 1;
|
||||
121
test/fixtures/es2015/uncategorised/382/expected.json
vendored
Normal file
121
test/fixtures/es2015/uncategorised/382/expected.json
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"specifiers": [],
|
||||
"source": null,
|
||||
"declaration": {
|
||||
"type": "VariableDeclaration",
|
||||
"start": 7,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 11,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 11,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"init": {
|
||||
"type": "NumericLiteral",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "let"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
test/fixtures/es2015/uncategorised/382/options.json
vendored
Normal file
3
test/fixtures/es2015/uncategorised/382/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceType": "module"
|
||||
}
|
||||
1
test/fixtures/es2015/uncategorised/383/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/383/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export class Foo {}
|
||||
100
test/fixtures/es2015/uncategorised/383/expected.json
vendored
Normal file
100
test/fixtures/es2015/uncategorised/383/expected.json
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"specifiers": [],
|
||||
"source": null,
|
||||
"declaration": {
|
||||
"type": "ClassDeclaration",
|
||||
"start": 7,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "Foo"
|
||||
},
|
||||
"name": "Foo"
|
||||
},
|
||||
"superClass": null,
|
||||
"body": {
|
||||
"type": "ClassBody",
|
||||
"start": 17,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
test/fixtures/es2015/uncategorised/383/options.json
vendored
Normal file
3
test/fixtures/es2015/uncategorised/383/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceType": "module"
|
||||
}
|
||||
1
test/fixtures/es2015/uncategorised/384/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/384/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export function foo() {}
|
||||
104
test/fixtures/es2015/uncategorised/384/expected.json
vendored
Normal file
104
test/fixtures/es2015/uncategorised/384/expected.json
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
{
|
||||
"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",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 0,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"specifiers": [],
|
||||
"source": null,
|
||||
"declaration": {
|
||||
"type": "FunctionDeclaration",
|
||||
"start": 7,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 16,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 22,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
test/fixtures/es2015/uncategorised/384/options.json
vendored
Normal file
3
test/fixtures/es2015/uncategorised/384/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceType": "module"
|
||||
}
|
||||
1
test/fixtures/es2015/uncategorised/385/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/385/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export async function foo() {}
|
||||
104
test/fixtures/es2015/uncategorised/385/expected.json
vendored
Normal file
104
test/fixtures/es2015/uncategorised/385/expected.json
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 0,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"specifiers": [],
|
||||
"source": null,
|
||||
"declaration": {
|
||||
"type": "FunctionDeclaration",
|
||||
"start": 7,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 22,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": true,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 28,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 28
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 30
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
test/fixtures/es2015/uncategorised/385/options.json
vendored
Normal file
3
test/fixtures/es2015/uncategorised/385/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceType": "module"
|
||||
}
|
||||
1
test/fixtures/es2015/uncategorised/386/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/386/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export typeof foo;
|
||||
5
test/fixtures/es2015/uncategorised/386/options.json
vendored
Normal file
5
test/fixtures/es2015/uncategorised/386/options.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token, expected { (1:7)"
|
||||
}
|
||||
|
||||
1
test/fixtures/es2015/uncategorised/387/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/387/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export new Foo();
|
||||
4
test/fixtures/es2015/uncategorised/387/options.json
vendored
Normal file
4
test/fixtures/es2015/uncategorised/387/options.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token, expected { (1:7)"
|
||||
}
|
||||
1
test/fixtures/es2015/uncategorised/388/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/388/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export function() {};
|
||||
4
test/fixtures/es2015/uncategorised/388/options.json
vendored
Normal file
4
test/fixtures/es2015/uncategorised/388/options.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token (1:15)"
|
||||
}
|
||||
1
test/fixtures/es2015/uncategorised/389/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/389/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export for (;;);
|
||||
4
test/fixtures/es2015/uncategorised/389/options.json
vendored
Normal file
4
test/fixtures/es2015/uncategorised/389/options.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token, expected { (1:7)"
|
||||
}
|
||||
1
test/fixtures/es2015/uncategorised/390/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/390/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export while(foo);
|
||||
4
test/fixtures/es2015/uncategorised/390/options.json
vendored
Normal file
4
test/fixtures/es2015/uncategorised/390/options.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Unexpected token, expected { (1:7)"
|
||||
}
|
||||
1
test/fixtures/es2015/uncategorised/391/actual.js
vendored
Normal file
1
test/fixtures/es2015/uncategorised/391/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
export function* foo() {};
|
||||
119
test/fixtures/es2015/uncategorised/391/expected.json
vendored
Normal file
119
test/fixtures/es2015/uncategorised/391/expected.json
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 0,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
}
|
||||
},
|
||||
"specifiers": [],
|
||||
"source": null,
|
||||
"declaration": {
|
||||
"type": "FunctionDeclaration",
|
||||
"start": 7,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"generator": true,
|
||||
"expression": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 23,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "EmptyStatement",
|
||||
"start": 25,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 25
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 26
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
test/fixtures/es2015/uncategorised/391/options.json
vendored
Normal file
3
test/fixtures/es2015/uncategorised/391/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceType": "module"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user