From 9ac671abec2aed7bbf31e40c9f6c9759d9d5a074 Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Sat, 8 Jul 2017 00:49:03 -0700 Subject: [PATCH] Upgrade: acorn to 5.1.1 (#347) --- package.json | 2 +- .../invalid-export-default-token.result.js | 4 +- .../invalid-export-named-default.result.js | 4 +- .../invalid-import-named-as-keyword.result.js | 4 +- .../invalid-import-named-keyword.result.js | 4 +- .../shorthand-properties-keyword.result.js | 4 +- .../destructuring-param.result.js | 3 +- .../destructuring-param.src.js | 0 .../async-wrapped-class-await.result.js | 554 ++++++++++++++++++ ...rc.js => async-wrapped-class-await.src.js} | 0 .../invalid-async-await-param.result.js | 6 +- ...id-async-method-await-identifier.result.js | 6 +- ...invalid-async-method-await-param.result.js | 6 +- .../invalid-async-method-expression.result.js | 6 +- ...nvalid-async-wrapped-class-await.result.js | 6 - ...invalid-await-destructured-param.result.js | 6 +- .../invalid-await-func-expression.result.js | 6 +- .../invalid-await-param-expression.result.js | 6 +- .../8/modules/invalid-await-param.result.js | 6 +- ...nvalid-nested-async-await-method.result.js | 6 - .../8/modules/invalid-nested-async.result.js | 6 +- .../nested-async-await-method.result.js | 536 +++++++++++++++++ ...rc.js => nested-async-await-method.src.js} | 0 .../async-wrapped-class-await.result.js | 554 ++++++++++++++++++ ...rc.js => async-wrapped-class-await.src.js} | 0 ...nvalid-async-wrapped-class-await.result.js | 6 - ...nvalid-nested-async-await-method.result.js | 6 - .../nested-async-await-method.result.js | 536 +++++++++++++++++ ...rc.js => nested-async-await-method.src.js} | 0 .../var-destructured-array-literal.result.js | 2 +- .../var-destructured-array-literal.src.js | 0 31 files changed, 2221 insertions(+), 64 deletions(-) rename tests/fixtures/ecma-version/{6/destructuring-and-spread => 8}/destructuring-param.result.js (99%) rename tests/fixtures/ecma-version/{6/destructuring-and-spread => 8}/destructuring-param.src.js (100%) create mode 100644 tests/fixtures/ecma-version/8/modules/async-wrapped-class-await.result.js rename tests/fixtures/ecma-version/8/modules/{invalid-async-wrapped-class-await.src.js => async-wrapped-class-await.src.js} (100%) delete mode 100644 tests/fixtures/ecma-version/8/modules/invalid-async-wrapped-class-await.result.js delete mode 100644 tests/fixtures/ecma-version/8/modules/invalid-nested-async-await-method.result.js create mode 100644 tests/fixtures/ecma-version/8/modules/nested-async-await-method.result.js rename tests/fixtures/ecma-version/8/modules/{invalid-nested-async-await-method.src.js => nested-async-await-method.src.js} (100%) create mode 100644 tests/fixtures/ecma-version/8/not-strict/async-wrapped-class-await.result.js rename tests/fixtures/ecma-version/8/not-strict/{invalid-async-wrapped-class-await.src.js => async-wrapped-class-await.src.js} (100%) delete mode 100644 tests/fixtures/ecma-version/8/not-strict/invalid-async-wrapped-class-await.result.js delete mode 100644 tests/fixtures/ecma-version/8/not-strict/invalid-nested-async-await-method.result.js create mode 100644 tests/fixtures/ecma-version/8/not-strict/nested-async-await-method.result.js rename tests/fixtures/ecma-version/8/not-strict/{invalid-nested-async-await-method.src.js => nested-async-await-method.src.js} (100%) rename tests/fixtures/ecma-version/{6/destructuring-and-spread => 8}/var-destructured-array-literal.result.js (99%) rename tests/fixtures/ecma-version/{6/destructuring-and-spread => 8}/var-destructured-array-literal.src.js (100%) diff --git a/package.json b/package.json index d4079034..fefc3e65 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^5.0.1", + "acorn": "^5.1.1", "acorn-jsx": "^3.0.0" }, "devDependencies": { diff --git a/tests/fixtures/ecma-version/6/modules/invalid-export-default-token.result.js b/tests/fixtures/ecma-version/6/modules/invalid-export-default-token.result.js index 7d0e4da8..8993d16e 100644 --- a/tests/fixtures/ecma-version/6/modules/invalid-export-default-token.result.js +++ b/tests/fixtures/ecma-version/6/modules/invalid-export-default-token.result.js @@ -2,5 +2,5 @@ module.exports = { "index": 8, "lineNumber": 1, "column": 9, - "message": "Unexpected token default" -}; \ No newline at end of file + "message": "Unexpected keyword 'default'" +} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/6/modules/invalid-export-named-default.result.js b/tests/fixtures/ecma-version/6/modules/invalid-export-named-default.result.js index 7d0e4da8..8993d16e 100644 --- a/tests/fixtures/ecma-version/6/modules/invalid-export-named-default.result.js +++ b/tests/fixtures/ecma-version/6/modules/invalid-export-named-default.result.js @@ -2,5 +2,5 @@ module.exports = { "index": 8, "lineNumber": 1, "column": 9, - "message": "Unexpected token default" -}; \ No newline at end of file + "message": "Unexpected keyword 'default'" +} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/6/modules/invalid-import-named-as-keyword.result.js b/tests/fixtures/ecma-version/6/modules/invalid-import-named-as-keyword.result.js index 3e7e7c84..8d917fb4 100644 --- a/tests/fixtures/ecma-version/6/modules/invalid-import-named-as-keyword.result.js +++ b/tests/fixtures/ecma-version/6/modules/invalid-import-named-as-keyword.result.js @@ -2,5 +2,5 @@ module.exports = { "index": 15, "lineNumber": 1, "column": 16, - "message": "Unexpected token var" -}; \ No newline at end of file + "message": "Unexpected keyword 'var'" +} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/6/modules/invalid-import-named-keyword.result.js b/tests/fixtures/ecma-version/6/modules/invalid-import-named-keyword.result.js index 71e99477..44f204d3 100644 --- a/tests/fixtures/ecma-version/6/modules/invalid-import-named-keyword.result.js +++ b/tests/fixtures/ecma-version/6/modules/invalid-import-named-keyword.result.js @@ -2,5 +2,5 @@ module.exports = { "index": 8, "lineNumber": 1, "column": 9, - "message": "Unexpected token var" -}; \ No newline at end of file + "message": "Unexpected keyword 'var'" +} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/6/objectLiteralShorthandProperties/shorthand-properties-keyword.result.js b/tests/fixtures/ecma-version/6/objectLiteralShorthandProperties/shorthand-properties-keyword.result.js index 47911f77..f56915e8 100644 --- a/tests/fixtures/ecma-version/6/objectLiteralShorthandProperties/shorthand-properties-keyword.result.js +++ b/tests/fixtures/ecma-version/6/objectLiteralShorthandProperties/shorthand-properties-keyword.result.js @@ -2,5 +2,5 @@ module.exports = { "index": 14, "lineNumber": 2, "column": 5, - "message": "'this' can not be used as shorthand property" -}; \ No newline at end of file + "message": "Unexpected keyword 'this'" +} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/6/destructuring-and-spread/destructuring-param.result.js b/tests/fixtures/ecma-version/8/destructuring-param.result.js similarity index 99% rename from tests/fixtures/ecma-version/6/destructuring-and-spread/destructuring-param.result.js rename to tests/fixtures/ecma-version/8/destructuring-param.result.js index 0caf4f0c..24a6c378 100644 --- a/tests/fixtures/ecma-version/6/destructuring-and-spread/destructuring-param.result.js +++ b/tests/fixtures/ecma-version/8/destructuring-param.result.js @@ -51,6 +51,7 @@ module.exports = { }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ArrayPattern", @@ -508,4 +509,4 @@ module.exports = { ] } ] -}; \ No newline at end of file +} diff --git a/tests/fixtures/ecma-version/6/destructuring-and-spread/destructuring-param.src.js b/tests/fixtures/ecma-version/8/destructuring-param.src.js similarity index 100% rename from tests/fixtures/ecma-version/6/destructuring-and-spread/destructuring-param.src.js rename to tests/fixtures/ecma-version/8/destructuring-param.src.js diff --git a/tests/fixtures/ecma-version/8/modules/async-wrapped-class-await.result.js b/tests/fixtures/ecma-version/8/modules/async-wrapped-class-await.result.js new file mode 100644 index 00000000..091d3047 --- /dev/null +++ b/tests/fixtures/ecma-version/8/modules/async-wrapped-class-await.result.js @@ -0,0 +1,554 @@ +module.exports = { + "type": "Program", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 0, + 56 + ], + "body": [ + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 0, + 55 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ], + "name": "wrap" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 22, + 55 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "range": [ + 26, + 53 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 32, + 33 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "range": [ + 34, + 53 + ], + "body": [ + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 35, + 52 + ], + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "range": [ + 41, + 46 + ], + "name": "await" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 46, + 52 + ], + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 49, + 52 + ], + "body": [] + } + } + } + ] + } + } + ] + } + }, + { + "type": "EmptyStatement", + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 55, + 56 + ] + } + ], + "sourceType": "module", + "tokens": [ + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 6, + 14 + ] + }, + { + "type": "Identifier", + "value": "wrap", + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 26, + 31 + ] + }, + { + "type": "Identifier", + "value": "A", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 32, + 33 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 35, + 40 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 55, + 56 + ] + } + ] +} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-async-wrapped-class-await.src.js b/tests/fixtures/ecma-version/8/modules/async-wrapped-class-await.src.js similarity index 100% rename from tests/fixtures/ecma-version/8/modules/invalid-async-wrapped-class-await.src.js rename to tests/fixtures/ecma-version/8/modules/async-wrapped-class-await.src.js diff --git a/tests/fixtures/ecma-version/8/modules/invalid-async-await-param.result.js b/tests/fixtures/ecma-version/8/modules/invalid-async-await-param.result.js index 98d145d9..e862d369 100644 --- a/tests/fixtures/ecma-version/8/modules/invalid-async-await-param.result.js +++ b/tests/fixtures/ecma-version/8/modules/invalid-async-await-param.result.js @@ -1,6 +1,6 @@ module.exports = { - "message": "The keyword 'await' is reserved", - "column": 20, "index": 19, - "lineNumber": 1 + "lineNumber": 1, + "column": 20, + "message": "Can not use 'await' as identifier inside an async function" } \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-async-method-await-identifier.result.js b/tests/fixtures/ecma-version/8/modules/invalid-async-method-await-identifier.result.js index fb31a118..30d7613b 100644 --- a/tests/fixtures/ecma-version/8/modules/invalid-async-method-await-identifier.result.js +++ b/tests/fixtures/ecma-version/8/modules/invalid-async-method-await-identifier.result.js @@ -1,6 +1,6 @@ module.exports = { - "message": "The keyword 'await' is reserved", - "column": 28, "index": 27, - "lineNumber": 1 + "lineNumber": 1, + "column": 28, + "message": "Can not use 'await' as identifier inside an async function" } \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-async-method-await-param.result.js b/tests/fixtures/ecma-version/8/modules/invalid-async-method-await-param.result.js index 98d145d9..e862d369 100644 --- a/tests/fixtures/ecma-version/8/modules/invalid-async-method-await-param.result.js +++ b/tests/fixtures/ecma-version/8/modules/invalid-async-method-await-param.result.js @@ -1,6 +1,6 @@ module.exports = { - "message": "The keyword 'await' is reserved", - "column": 20, "index": 19, - "lineNumber": 1 + "lineNumber": 1, + "column": 20, + "message": "Can not use 'await' as identifier inside an async function" } \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-async-method-expression.result.js b/tests/fixtures/ecma-version/8/modules/invalid-async-method-expression.result.js index cbed3073..351656b4 100644 --- a/tests/fixtures/ecma-version/8/modules/invalid-async-method-expression.result.js +++ b/tests/fixtures/ecma-version/8/modules/invalid-async-method-expression.result.js @@ -1,6 +1,6 @@ module.exports = { - "message": "The keyword 'await' is reserved", - "column": 21, "index": 20, - "lineNumber": 1 + "lineNumber": 1, + "column": 21, + "message": "Can not use 'await' as identifier inside an async function" } \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-async-wrapped-class-await.result.js b/tests/fixtures/ecma-version/8/modules/invalid-async-wrapped-class-await.result.js deleted file mode 100644 index e1aae2a2..00000000 --- a/tests/fixtures/ecma-version/8/modules/invalid-async-wrapped-class-await.result.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - "message": "Can not use 'await' as identifier inside an async function", - "column": 18, - "index": 41, - "lineNumber": 2 -} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-await-destructured-param.result.js b/tests/fixtures/ecma-version/8/modules/invalid-await-destructured-param.result.js index 198710e1..08a18bcd 100644 --- a/tests/fixtures/ecma-version/8/modules/invalid-await-destructured-param.result.js +++ b/tests/fixtures/ecma-version/8/modules/invalid-await-destructured-param.result.js @@ -1,6 +1,6 @@ module.exports = { - "message": "'await' can not be used as shorthand property", - "column": 9, "index": 8, - "lineNumber": 1 + "lineNumber": 1, + "column": 9, + "message": "The keyword 'await' is reserved" } \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-await-func-expression.result.js b/tests/fixtures/ecma-version/8/modules/invalid-await-func-expression.result.js index a724ec87..e333aacc 100644 --- a/tests/fixtures/ecma-version/8/modules/invalid-await-func-expression.result.js +++ b/tests/fixtures/ecma-version/8/modules/invalid-await-func-expression.result.js @@ -1,6 +1,6 @@ module.exports = { - "message": "The keyword 'await' is reserved", - "column": 17, "index": 16, - "lineNumber": 1 + "lineNumber": 1, + "column": 17, + "message": "Can not use 'await' as identifier inside an async function" } \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-await-param-expression.result.js b/tests/fixtures/ecma-version/8/modules/invalid-await-param-expression.result.js index cbed3073..351656b4 100644 --- a/tests/fixtures/ecma-version/8/modules/invalid-await-param-expression.result.js +++ b/tests/fixtures/ecma-version/8/modules/invalid-await-param-expression.result.js @@ -1,6 +1,6 @@ module.exports = { - "message": "The keyword 'await' is reserved", - "column": 21, "index": 20, - "lineNumber": 1 + "lineNumber": 1, + "column": 21, + "message": "Can not use 'await' as identifier inside an async function" } \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-await-param.result.js b/tests/fixtures/ecma-version/8/modules/invalid-await-param.result.js index 98d145d9..e862d369 100644 --- a/tests/fixtures/ecma-version/8/modules/invalid-await-param.result.js +++ b/tests/fixtures/ecma-version/8/modules/invalid-await-param.result.js @@ -1,6 +1,6 @@ module.exports = { - "message": "The keyword 'await' is reserved", - "column": 20, "index": 19, - "lineNumber": 1 + "lineNumber": 1, + "column": 20, + "message": "Can not use 'await' as identifier inside an async function" } \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-nested-async-await-method.result.js b/tests/fixtures/ecma-version/8/modules/invalid-nested-async-await-method.result.js deleted file mode 100644 index 0455d299..00000000 --- a/tests/fixtures/ecma-version/8/modules/invalid-nested-async-await-method.result.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - "message": "Can not use 'await' as identifier inside an async function", - "column": 11, - "index": 34, - "lineNumber": 2 -} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-nested-async.result.js b/tests/fixtures/ecma-version/8/modules/invalid-nested-async.result.js index f53f0666..d5697e80 100644 --- a/tests/fixtures/ecma-version/8/modules/invalid-nested-async.result.js +++ b/tests/fixtures/ecma-version/8/modules/invalid-nested-async.result.js @@ -1,6 +1,6 @@ module.exports = { - "message": "The keyword 'await' is reserved", - "column": 18, "index": 41, - "lineNumber": 2 + "lineNumber": 2, + "column": 18, + "message": "Can not use 'await' as identifier inside an async function" } \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/nested-async-await-method.result.js b/tests/fixtures/ecma-version/8/modules/nested-async-await-method.result.js new file mode 100644 index 00000000..479d1171 --- /dev/null +++ b/tests/fixtures/ecma-version/8/modules/nested-async-await-method.result.js @@ -0,0 +1,536 @@ +module.exports = { + "type": "Program", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 0, + 50 + ], + "body": [ + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 0, + 49 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ], + "name": "wrap" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 22, + 49 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "range": [ + 26, + 47 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "range": [ + 27, + 46 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "range": [ + 28, + 45 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "range": [ + 34, + 39 + ], + "name": "await" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "range": [ + 39, + 45 + ], + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "range": [ + 42, + 45 + ], + "body": [] + } + } + } + ] + } + } + ] + } + }, + { + "type": "EmptyStatement", + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 49, + 50 + ] + } + ], + "sourceType": "module", + "tokens": [ + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 6, + 14 + ] + }, + { + "type": "Identifier", + "value": "wrap", + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 28, + 33 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "range": [ + 34, + 39 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "range": [ + 42, + 43 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 49, + 50 + ] + } + ] +} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/modules/invalid-nested-async-await-method.src.js b/tests/fixtures/ecma-version/8/modules/nested-async-await-method.src.js similarity index 100% rename from tests/fixtures/ecma-version/8/modules/invalid-nested-async-await-method.src.js rename to tests/fixtures/ecma-version/8/modules/nested-async-await-method.src.js diff --git a/tests/fixtures/ecma-version/8/not-strict/async-wrapped-class-await.result.js b/tests/fixtures/ecma-version/8/not-strict/async-wrapped-class-await.result.js new file mode 100644 index 00000000..fc77a451 --- /dev/null +++ b/tests/fixtures/ecma-version/8/not-strict/async-wrapped-class-await.result.js @@ -0,0 +1,554 @@ +module.exports = { + "type": "Program", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 0, + 56 + ], + "body": [ + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 0, + 55 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ], + "name": "wrap" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 22, + 55 + ], + "body": [ + { + "type": "ClassDeclaration", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "range": [ + 26, + 53 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 32, + 33 + ], + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "range": [ + 34, + 53 + ], + "body": [ + { + "type": "MethodDefinition", + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 35, + 52 + ], + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "range": [ + 41, + 46 + ], + "name": "await" + }, + "static": false, + "kind": "method", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 46, + 52 + ], + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 49, + 52 + ], + "body": [] + } + } + } + ] + } + } + ] + } + }, + { + "type": "EmptyStatement", + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 55, + 56 + ] + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 6, + 14 + ] + }, + { + "type": "Identifier", + "value": "wrap", + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ] + }, + { + "type": "Keyword", + "value": "class", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 26, + 31 + ] + }, + { + "type": "Identifier", + "value": "A", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 32, + 33 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 34, + 35 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 35, + 40 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "range": [ + 41, + 46 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "range": [ + 47, + 48 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "range": [ + 49, + 50 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 54, + 55 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 55, + 56 + ] + } + ] +} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/not-strict/invalid-async-wrapped-class-await.src.js b/tests/fixtures/ecma-version/8/not-strict/async-wrapped-class-await.src.js similarity index 100% rename from tests/fixtures/ecma-version/8/not-strict/invalid-async-wrapped-class-await.src.js rename to tests/fixtures/ecma-version/8/not-strict/async-wrapped-class-await.src.js diff --git a/tests/fixtures/ecma-version/8/not-strict/invalid-async-wrapped-class-await.result.js b/tests/fixtures/ecma-version/8/not-strict/invalid-async-wrapped-class-await.result.js deleted file mode 100644 index e1aae2a2..00000000 --- a/tests/fixtures/ecma-version/8/not-strict/invalid-async-wrapped-class-await.result.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - "message": "Can not use 'await' as identifier inside an async function", - "column": 18, - "index": 41, - "lineNumber": 2 -} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/not-strict/invalid-nested-async-await-method.result.js b/tests/fixtures/ecma-version/8/not-strict/invalid-nested-async-await-method.result.js deleted file mode 100644 index 0455d299..00000000 --- a/tests/fixtures/ecma-version/8/not-strict/invalid-nested-async-await-method.result.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - "message": "Can not use 'await' as identifier inside an async function", - "column": 11, - "index": 34, - "lineNumber": 2 -} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/not-strict/nested-async-await-method.result.js b/tests/fixtures/ecma-version/8/not-strict/nested-async-await-method.result.js new file mode 100644 index 00000000..e4ac3b14 --- /dev/null +++ b/tests/fixtures/ecma-version/8/not-strict/nested-async-await-method.result.js @@ -0,0 +1,536 @@ +module.exports = { + "type": "Program", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 0, + 50 + ], + "body": [ + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 0, + 49 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ], + "name": "wrap" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 22, + 49 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "range": [ + 26, + 47 + ], + "expression": { + "type": "ObjectExpression", + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "range": [ + 27, + 46 + ], + "properties": [ + { + "type": "Property", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "range": [ + 28, + 45 + ], + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "range": [ + 34, + 39 + ], + "name": "await" + }, + "kind": "init", + "value": { + "type": "FunctionExpression", + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "range": [ + 39, + 45 + ], + "id": null, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "range": [ + 42, + 45 + ], + "body": [] + } + } + } + ] + } + } + ] + } + }, + { + "type": "EmptyStatement", + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 49, + 50 + ] + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 6, + 14 + ] + }, + { + "type": "Identifier", + "value": "wrap", + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 15, + 19 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 22, + 23 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "range": [ + 26, + 27 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "range": [ + 27, + 28 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 28, + 33 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "range": [ + 34, + 39 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 39, + 40 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "range": [ + 42, + 43 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "range": [ + 45, + 46 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 48, + 49 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "range": [ + 49, + 50 + ] + } + ] +} \ No newline at end of file diff --git a/tests/fixtures/ecma-version/8/not-strict/invalid-nested-async-await-method.src.js b/tests/fixtures/ecma-version/8/not-strict/nested-async-await-method.src.js similarity index 100% rename from tests/fixtures/ecma-version/8/not-strict/invalid-nested-async-await-method.src.js rename to tests/fixtures/ecma-version/8/not-strict/nested-async-await-method.src.js diff --git a/tests/fixtures/ecma-version/6/destructuring-and-spread/var-destructured-array-literal.result.js b/tests/fixtures/ecma-version/8/var-destructured-array-literal.result.js similarity index 99% rename from tests/fixtures/ecma-version/6/destructuring-and-spread/var-destructured-array-literal.result.js rename to tests/fixtures/ecma-version/8/var-destructured-array-literal.result.js index 7610b6e9..f5464cf0 100644 --- a/tests/fixtures/ecma-version/6/destructuring-and-spread/var-destructured-array-literal.result.js +++ b/tests/fixtures/ecma-version/8/var-destructured-array-literal.result.js @@ -435,4 +435,4 @@ module.exports = { ] } ] -}; \ No newline at end of file +} diff --git a/tests/fixtures/ecma-version/6/destructuring-and-spread/var-destructured-array-literal.src.js b/tests/fixtures/ecma-version/8/var-destructured-array-literal.src.js similarity index 100% rename from tests/fixtures/ecma-version/6/destructuring-and-spread/var-destructured-array-literal.src.js rename to tests/fixtures/ecma-version/8/var-destructured-array-literal.src.js