From ed625cb2e153841e9c729b4a66adb7f4f518e213 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Tue, 10 Jan 2017 20:14:11 +0100 Subject: [PATCH 001/105] Remove `String.fromCodePoint` shim (#279) This is not necessary anymore if we drop support for Node.js v0.10 and v0.12. Ref. https://github.com/babel/babel/issues/4315. --- src/plugins/jsx/fromCodePoint.js | 66 -------------------- src/plugins/jsx/index.js | 6 +- test/fixtures/jsx/basic/entity/expected.json | 4 +- 3 files changed, 4 insertions(+), 72 deletions(-) delete mode 100644 src/plugins/jsx/fromCodePoint.js diff --git a/src/plugins/jsx/fromCodePoint.js b/src/plugins/jsx/fromCodePoint.js deleted file mode 100644 index a69acf7686..0000000000 --- a/src/plugins/jsx/fromCodePoint.js +++ /dev/null @@ -1,66 +0,0 @@ -// Adapted from String.fromcodepoint to export the function without modifying String -/*! https://mths.be/fromcodepoint v0.2.1 by @mathias */ - -// The MIT License (MIT) -// Copyright (c) Mathias Bynens -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -// associated documentation files (the "Software"), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, publish, distribute, -// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT -// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -let fromCodePoint = String.fromCodePoint; - -if (!fromCodePoint) { - const stringFromCharCode = String.fromCharCode; - const floor = Math.floor; - fromCodePoint = function() { - const MAX_SIZE = 0x4000; - const codeUnits = []; - let highSurrogate; - let lowSurrogate; - let index = -1; - const length = arguments.length; - if (!length) { - return ""; - } - let result = ""; - while (++index < length) { - let codePoint = Number(arguments[index]); - if ( - !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity` - codePoint < 0 || // not a valid Unicode code point - codePoint > 0x10FFFF || // not a valid Unicode code point - floor(codePoint) != codePoint // not an integer - ) { - throw RangeError("Invalid code point: " + codePoint); - } - if (codePoint <= 0xFFFF) { // BMP code point - codeUnits.push(codePoint); - } else { // Astral code point; split in surrogate halves - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - codePoint -= 0x10000; - highSurrogate = (codePoint >> 10) + 0xD800; - lowSurrogate = (codePoint % 0x400) + 0xDC00; - codeUnits.push(highSurrogate, lowSurrogate); - } - if (index + 1 == length || codeUnits.length > MAX_SIZE) { - result += stringFromCharCode.apply(null, codeUnits); - codeUnits.length = 0; - } - } - return result; - }; -} - -export default fromCodePoint; diff --git a/src/plugins/jsx/index.js b/src/plugins/jsx/index.js index bd4633a095..31bf94de8b 100644 --- a/src/plugins/jsx/index.js +++ b/src/plugins/jsx/index.js @@ -1,7 +1,5 @@ /* eslint indent: 0 */ -import fromCodePoint from "./fromCodePoint"; - import XHTMLEntities from "./xhtml"; import { TokenType, types as tt } from "../../tokenizer/types"; import { TokContext, types as tc } from "../../tokenizer/context"; @@ -138,11 +136,11 @@ pp.jsxReadEntity = function() { if (str[1] === "x") { str = str.substr(2); if (HEX_NUMBER.test(str)) - entity = fromCodePoint(parseInt(str, 16)); + entity = String.fromCodePoint(parseInt(str, 16)); } else { str = str.substr(1); if (DECIMAL_NUMBER.test(str)) - entity = fromCodePoint(parseInt(str, 10)); + entity = String.fromCodePoint(parseInt(str, 10)); } } else { entity = XHTMLEntities[str]; diff --git a/test/fixtures/jsx/basic/entity/expected.json b/test/fixtures/jsx/basic/entity/expected.json index 69f4b59ea6..8e4d867723 100644 --- a/test/fixtures/jsx/basic/entity/expected.json +++ b/test/fixtures/jsx/basic/entity/expected.json @@ -136,7 +136,7 @@ } }, "extra": null, - "value": "💩" + "value": "\uD83D\uDCA9" } ] } @@ -144,4 +144,4 @@ ], "directives": [] } -} \ No newline at end of file +} From b72d4d40a5a4fa8f76bda8d0f064445d6afddf83 Mon Sep 17 00:00:00 2001 From: Sergey Rubanov Date: Fri, 13 Jan 2017 00:51:05 +0300 Subject: [PATCH 002/105] [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) * Remove node 0.10, 0.12 and 5 from Travis * add engines to package.json --- .travis.yml | 10 ---------- package.json | 4 ++++ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index e1d38de890..88a08570a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,14 @@ sudo: false language: node_js node_js: - - "0.10" - - "0.12" - "4" - - "5" - "6" - "7" -before_install: - # Rollup doesn't support node < 4.x. Switch to latest for build - - . $HOME/.nvm/nvm.sh - - nvm install stable && nvm use stable - before_script: - 'if [ -n "${BABEL-}" ]; then make bootstrap-babel ; fi' - 'if [ -n "${FLOWTESTS-}" ]; then make bootstrap-flow ; fi' - 'BABEL_ENV=test npm run build' - # Switch back to node version currently being tested prior to test run - - 'nvm use $TRAVIS_NODE_VERSION;' script: - 'if [ -n "${LINT-}" ]; then npm run lint ; fi' diff --git a/package.json b/package.json index f8dfe1c530..4e77054390 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,10 @@ "bin", "lib" ], + "engines" : { + "node" : ">=4.2.0", + "npm": ">=2.14.7" + }, "devDependencies": { "ava": "^0.17.0", "babel-cli": "^6.14.0", From 8f7a19e3ad73ddf2563420d3c01ede8234cba5aa Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Thu, 12 Jan 2017 22:53:48 +0100 Subject: [PATCH 003/105] Update cross-env to 3.x --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4e77054390..08da59e5c1 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,7 @@ "lib" ], "engines" : { - "node" : ">=4.2.0", - "npm": ">=2.14.7" + "node" : ">=4.2.0" }, "devDependencies": { "ava": "^0.17.0", @@ -27,7 +26,7 @@ "babel-preset-stage-0": "^6.5.0", "chalk": "^1.1.3", "codecov": "^1.0.1", - "cross-env": "^2.0.0", + "cross-env": "^3.1.4", "eslint": "^3.7.1", "eslint-config-babel": "^4.0.1", "eslint-plugin-babel": "^4.0.0", From 7a3e717f15f2509a9e9cafbe3779aac948e236de Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Thu, 12 Jan 2017 22:55:00 +0100 Subject: [PATCH 004/105] Update yarn.lock --- package.json | 4 +-- yarn.lock | 70 ++++------------------------------------------------ 2 files changed, 7 insertions(+), 67 deletions(-) diff --git a/package.json b/package.json index 08da59e5c1..5917364d73 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "bin", "lib" ], - "engines" : { - "node" : ">=4.2.0" + "engines": { + "node": ">=4.2.0" }, "devDependencies": { "ava": "^0.17.0", diff --git a/yarn.lock b/yarn.lock index 06840b05bb..710e46a763 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1000,8 +1000,8 @@ babel-types@^6.13.0, babel-types@^6.15.0, babel-types@^6.16.0, babel-types@^6.18 to-fast-properties "^1.0.1" babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0: - version "6.14.1" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.14.1.tgz#956275fab72753ad9b3435d7afe58f8bf0a29815" + version "6.15.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" balanced-match@^0.4.1: version "0.4.2" @@ -1329,12 +1329,11 @@ create-error-class@^3.0.1: dependencies: capture-stack-trace "^1.0.0" -cross-env@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-2.0.1.tgz#f283b4039ea759ada9ab7e987ad3bddb241b79a6" +cross-env@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-3.1.4.tgz#56e8bca96f17908a6eb1bc2012ca126f92842130" dependencies: cross-spawn "^3.0.1" - lodash.assign "^3.2.0" cross-spawn@^3.0.1: version "3.0.1" @@ -2447,45 +2446,6 @@ load-json-file@^1.0.0, load-json-file@^1.1.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" - dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._bindcallback@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - -lodash._createassigner@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz#838a5bae2fdaca63ac22dee8e19fa4e6d6970b11" - dependencies: - lodash._bindcallback "^3.0.0" - lodash._isiterateecall "^3.0.0" - lodash.restparam "^3.0.0" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - -lodash.assign@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-3.2.0.tgz#3ce9f0234b4b2223e296b8fa0ac1fee8ebca64fa" - dependencies: - lodash._baseassign "^3.0.0" - lodash._createassigner "^3.0.0" - lodash.keys "^3.0.0" - lodash.debounce@^4.0.3: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -2498,34 +2458,14 @@ lodash.flatten@^4.2.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - lodash.isequal@^4.4.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - lodash.pickby@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" -lodash.restparam@^3.0.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" From 00f03bb3b0b9862f49e5cdc8164649d88adfa43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Pe=C3=B1a?= Date: Mon, 16 Jan 2017 04:34:23 -0500 Subject: [PATCH 005/105] Remove '*' as a plugin option (#301) --- src/parser/index.js | 35 --- .../jsx/regression/test-star-option/actual.js | 4 - .../regression/test-star-option/expected.json | 277 ------------------ .../regression/test-star-option/options.json | 3 - 4 files changed, 319 deletions(-) delete mode 100644 test/fixtures/jsx/regression/test-star-option/actual.js delete mode 100644 test/fixtures/jsx/regression/test-star-option/expected.json delete mode 100644 test/fixtures/jsx/regression/test-star-option/options.json diff --git a/src/parser/index.js b/src/parser/index.js index fc6a98bd4e..ef296c21af 100644 --- a/src/parser/index.js +++ b/src/parser/index.js @@ -3,19 +3,6 @@ import { getOptions } from "../options"; import Tokenizer from "../tokenizer"; export const plugins = {}; -const frozenDeprecatedWildcardPluginList = [ - "jsx", - "doExpressions", - "objectRestSpread", - "decorators", - "classProperties", - "exportExtensions", - "asyncGenerators", - "functionBind", - "functionSent", - "dynamicImport", - "flow" -]; export default class Parser extends Tokenizer { constructor(options: Object, input: string) { @@ -43,10 +30,6 @@ export default class Parser extends Tokenizer { } hasPlugin(name: string): boolean { - if (this.plugins["*"] && frozenDeprecatedWildcardPluginList.indexOf(name) > -1) { - return true; - } - return !!this.plugins[name]; } @@ -54,25 +37,7 @@ export default class Parser extends Tokenizer { this[name] = f(this[name]); } - loadAllPlugins() { - // ensure flow plugin loads last - const pluginNames = Object.keys(plugins).filter((name) => name !== "flow"); - pluginNames.push("flow"); - - pluginNames.forEach((name) => { - const plugin = plugins[name]; - if (plugin) plugin(this); - }); - } - loadPlugins(pluginList: Array): { [key: string]: boolean } { - // TODO: Deprecate "*" option in next major version of Babylon - if (pluginList.indexOf("*") >= 0) { - this.loadAllPlugins(); - - return { "*": true }; - } - const pluginMap = {}; if (pluginList.indexOf("flow") >= 0) { diff --git a/test/fixtures/jsx/regression/test-star-option/actual.js b/test/fixtures/jsx/regression/test-star-option/actual.js deleted file mode 100644 index 7aeab8e0ec..0000000000 --- a/test/fixtures/jsx/regression/test-star-option/actual.js +++ /dev/null @@ -1,4 +0,0 @@ -function A(): void { - a::b; -
; -} diff --git a/test/fixtures/jsx/regression/test-star-option/expected.json b/test/fixtures/jsx/regression/test-star-option/expected.json deleted file mode 100644 index 1d0e4b71f8..0000000000 --- a/test/fixtures/jsx/regression/test-star-option/expected.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "A" - }, - "name": "A" - }, - "generator": false, - "expression": false, - "async": false, - "params": [], - "returnType": { - "type": "TypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "typeAnnotation": { - "type": "VoidTypeAnnotation", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } - } - }, - "body": { - "type": "BlockStatement", - "start": 19, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 4, - "column": 1 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "expression": { - "type": "BindExpression", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, - "object": { - "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "a" - }, - "name": "a" - }, - "callee": { - "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "b" - }, - "name": "b" - } - } - }, - { - "type": "ExpressionStatement", - "start": 31, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, - "expression": { - "type": "JSXElement", - "start": 31, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, - "openingElement": { - "type": "JSXOpeningElement", - "start": 31, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "attributes": [], - "name": { - "type": "JSXIdentifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 6 - } - }, - "name": "div" - }, - "selfClosing": false - }, - "closingElement": { - "type": "JSXClosingElement", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - }, - "name": { - "type": "JSXIdentifier", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 12 - } - }, - "name": "div" - } - }, - "children": [] - } - } - ], - "directives": [] - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/jsx/regression/test-star-option/options.json b/test/fixtures/jsx/regression/test-star-option/options.json deleted file mode 100644 index 2f56a201da..0000000000 --- a/test/fixtures/jsx/regression/test-star-option/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["*"] -} From c5462e1a30fb76dc11b4cb11c52779127b7ab3d6 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Mon, 16 Jan 2017 03:49:42 -0600 Subject: [PATCH 006/105] Remove classConstructorCall plugin (#291) --- src/parser/statement.js | 20 +- .../.duplicate/actual.js | 4 - .../illegal-generator/actual.js | 5 - .../illegal-generator/options.json | 3 - .../illegal-key/actual.js | 5 - .../illegal-key/options.json | 3 - .../class-constructor-call/options.json | 3 - .../class-constructor-call/plain/actual.js | 5 - .../plain/expected.json | 186 ------------------ 9 files changed, 3 insertions(+), 231 deletions(-) delete mode 100644 test/fixtures/experimental/class-constructor-call/.duplicate/actual.js delete mode 100644 test/fixtures/experimental/class-constructor-call/illegal-generator/actual.js delete mode 100644 test/fixtures/experimental/class-constructor-call/illegal-generator/options.json delete mode 100644 test/fixtures/experimental/class-constructor-call/illegal-key/actual.js delete mode 100644 test/fixtures/experimental/class-constructor-call/illegal-key/options.json delete mode 100644 test/fixtures/experimental/class-constructor-call/options.json delete mode 100644 test/fixtures/experimental/class-constructor-call/plain/actual.js delete mode 100644 test/fixtures/experimental/class-constructor-call/plain/expected.json diff --git a/src/parser/statement.js b/src/parser/statement.js index cfff7be0a7..421b044cfc 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -636,7 +636,6 @@ pp.parseClassBody = function (node) { const oldStrict = this.state.strict; this.state.strict = true; - let hadConstructorCall = false; let hadConstructor = false; let decorators = []; const classBody = this.startNode(); @@ -663,7 +662,6 @@ pp.parseClassBody = function (node) { decorators = []; } - let isConstructorCall = false; const isMaybeStatic = this.match(tt.name) && this.state.value === "static"; let isGenerator = this.eat(tt.star); let isGetSet = false; @@ -682,11 +680,6 @@ pp.parseClassBody = function (node) { classBody.body.push(this.parseClassProperty(method)); continue; } - - if (method.key.type === "Identifier" && !method.computed && this.hasPlugin("classConstructorCall") && method.key.name === "call" && this.match(tt.name) && this.state.value === "constructor") { - isConstructorCall = true; - this.parsePropertyName(method); - } } const isAsyncMethod = !this.match(tt.parenL) && !method.computed && method.key.type === "Identifier" && method.key.name === "async"; @@ -710,7 +703,7 @@ pp.parseClassBody = function (node) { } // disallow invalid constructors - const isConstructor = !isConstructorCall && !method.static && ( + const isConstructor = !method.static && ( (key.type === "Identifier" && key.name === "constructor") || (key.type === "StringLiteral" && key.value === "constructor") ); @@ -733,15 +726,8 @@ pp.parseClassBody = function (node) { } } - // convert constructor to a constructor call - if (isConstructorCall) { - if (hadConstructorCall) this.raise(method.start, "Duplicate constructor call in the same class"); - method.kind = "constructorCall"; - hadConstructorCall = true; - } - - // disallow decorators on class constructors - if ((method.kind === "constructor" || method.kind === "constructorCall") && method.decorators) { + // disallow decorators on class constructors + if (method.kind === "constructor" && method.decorators) { this.raise(method.start, "You can't attach decorators to a class constructor"); } diff --git a/test/fixtures/experimental/class-constructor-call/.duplicate/actual.js b/test/fixtures/experimental/class-constructor-call/.duplicate/actual.js deleted file mode 100644 index 6fd5dd7d11..0000000000 --- a/test/fixtures/experimental/class-constructor-call/.duplicate/actual.js +++ /dev/null @@ -1,4 +0,0 @@ -class Foo { - call constructor() {} - call constructor() {} -} diff --git a/test/fixtures/experimental/class-constructor-call/illegal-generator/actual.js b/test/fixtures/experimental/class-constructor-call/illegal-generator/actual.js deleted file mode 100644 index 9a3bd5d8d6..0000000000 --- a/test/fixtures/experimental/class-constructor-call/illegal-generator/actual.js +++ /dev/null @@ -1,5 +0,0 @@ -class Foo { - *call constructor() { - foo(); - } -} diff --git a/test/fixtures/experimental/class-constructor-call/illegal-generator/options.json b/test/fixtures/experimental/class-constructor-call/illegal-generator/options.json deleted file mode 100644 index db35c194d3..0000000000 --- a/test/fixtures/experimental/class-constructor-call/illegal-generator/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected ( (2:8)" -} diff --git a/test/fixtures/experimental/class-constructor-call/illegal-key/actual.js b/test/fixtures/experimental/class-constructor-call/illegal-key/actual.js deleted file mode 100644 index e3155a24a8..0000000000 --- a/test/fixtures/experimental/class-constructor-call/illegal-key/actual.js +++ /dev/null @@ -1,5 +0,0 @@ -class Foo { - call foobar() { - foo(); - } -} diff --git a/test/fixtures/experimental/class-constructor-call/illegal-key/options.json b/test/fixtures/experimental/class-constructor-call/illegal-key/options.json deleted file mode 100644 index 606cbed9d9..0000000000 --- a/test/fixtures/experimental/class-constructor-call/illegal-key/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected ( (2:7)" -} diff --git a/test/fixtures/experimental/class-constructor-call/options.json b/test/fixtures/experimental/class-constructor-call/options.json deleted file mode 100644 index 253cf5199b..0000000000 --- a/test/fixtures/experimental/class-constructor-call/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classConstructorCall"] -} diff --git a/test/fixtures/experimental/class-constructor-call/plain/actual.js b/test/fixtures/experimental/class-constructor-call/plain/actual.js deleted file mode 100644 index 1f8b64ef4a..0000000000 --- a/test/fixtures/experimental/class-constructor-call/plain/actual.js +++ /dev/null @@ -1,5 +0,0 @@ -class Foo { - call constructor() { - foo(); - } -} diff --git a/test/fixtures/experimental/class-constructor-call/plain/expected.json b/test/fixtures/experimental/class-constructor-call/plain/expected.json deleted file mode 100644 index 49c89dadbc..0000000000 --- a/test/fixtures/experimental/class-constructor-call/plain/expected.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ClassDeclaration", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, - "id": { - "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, - "name": "Foo" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 10, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 5, - "column": 1 - } - }, - "body": [ - { - "type": "ClassMethod", - "start": 14, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "computed": false, - "key": { - "type": "Identifier", - "start": 19, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 18 - } - }, - "name": "constructor" - }, - "static": false, - "kind": "constructorCall", - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 33, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 39, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 10 - } - }, - "expression": { - "type": "CallExpression", - "start": 39, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 9 - } - }, - "callee": { - "type": "Identifier", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, - "name": "foo" - }, - "arguments": [] - } - } - ], - "directives": [] - } - } - ] - } - } - ], - "directives": [] - } -} \ No newline at end of file From bd001767fb54b1ab66c3abf6b61eaf7dcfdf5047 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 16 Jan 2017 10:50:51 +0100 Subject: [PATCH 007/105] Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) This reverts commit 5bac6e8ad99bcbf608f6df30d9942d6269f88fac. --- src/parser/expression.js | 4 +- .../object-rest-spread/8/expected.json | 243 ------------------ .../object-rest-spread/8/options.json | 3 + 3 files changed, 4 insertions(+), 246 deletions(-) delete mode 100644 test/fixtures/experimental/object-rest-spread/8/expected.json create mode 100644 test/fixtures/experimental/object-rest-spread/8/options.json diff --git a/src/parser/expression.js b/src/parser/expression.js index 9deb74c686..81cb3766ed 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -749,9 +749,7 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) { } else if (this.eat(tt.braceR)) { break; } else if (this.match(tt.comma) && this.lookahead().type === tt.braceR) { - // TODO: temporary rollback - // this.unexpected(position, "A trailing comma is not permitted after the rest element"); - continue; + this.unexpected(position, "A trailing comma is not permitted after the rest element"); } else { firstRestLocation = position; continue; diff --git a/test/fixtures/experimental/object-rest-spread/8/expected.json b/test/fixtures/experimental/object-rest-spread/8/expected.json deleted file mode 100644 index f97a0ab95c..0000000000 --- a/test/fixtures/experimental/object-rest-spread/8/expected.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "id": { - "type": "ObjectPattern", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "properties": [ - { - "type": "ObjectProperty", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, - "name": "x" - }, - "value": { - "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, - "name": "x" - }, - "extra": { - "shorthand": true - } - }, - { - "type": "ObjectProperty", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "y" - }, - "name": "y" - }, - "value": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "y" - }, - "name": "y" - }, - "extra": { - "shorthand": true - } - }, - { - "type": "RestProperty", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "argument": { - "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "z" - }, - "name": "z" - } - } - ] - }, - "init": { - "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "obj" - }, - "name": "obj" - } - } - ], - "kind": "let" - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/8/options.json b/test/fixtures/experimental/object-rest-spread/8/options.json new file mode 100644 index 0000000000..4a97ac85ea --- /dev/null +++ b/test/fixtures/experimental/object-rest-spread/8/options.json @@ -0,0 +1,3 @@ +{ + "throws": "A trailing comma is not permitted after the rest element (1:16)" +} From c424156751208330cb9ca957e90758a5db445f72 Mon Sep 17 00:00:00 2001 From: Toru Kobayashi Date: Sat, 28 Jan 2017 03:42:15 +0900 Subject: [PATCH 008/105] Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) --- src/plugins/flow.js | 2 +- .../type-annotations/existential-type-param-2/expected.json | 6 +++--- .../type-annotations/existential-type-param/expected.json | 4 ++-- .../flow/type-parameter-declaration/default/expected.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/flow.js b/src/plugins/flow.js index db2fc7724e..3aa7323e3e 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -676,7 +676,7 @@ pp.flowParsePrimaryType = function () { case tt.star: this.next(); - return this.finishNode(node, "ExistentialTypeParam"); + return this.finishNode(node, "ExistsTypeAnnotation"); default: if (this.state.type.keyword === "typeof") { diff --git a/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json b/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json index 12bf9c1462..ce2c3dc1c1 100644 --- a/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json +++ b/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json @@ -87,7 +87,7 @@ } }, "typeAnnotation": { - "type": "ExistentialTypeParam", + "type": "ExistsTypeAnnotation", "start": 8, "end": 9, "loc": { @@ -132,7 +132,7 @@ } }, "typeAnnotation": { - "type": "ExistentialTypeParam", + "type": "ExistsTypeAnnotation", "start": 30, "end": 31, "loc": { @@ -213,7 +213,7 @@ "value": true }, { - "type": "ExistentialTypeParam", + "type": "ExistsTypeAnnotation", "start": 24, "end": 25, "loc": { diff --git a/test/fixtures/flow/type-annotations/existential-type-param/expected.json b/test/fixtures/flow/type-annotations/existential-type-param/expected.json index d9e6a9657d..7739b86598 100644 --- a/test/fixtures/flow/type-annotations/existential-type-param/expected.json +++ b/test/fixtures/flow/type-annotations/existential-type-param/expected.json @@ -153,7 +153,7 @@ } }, { - "type": "ExistentialTypeParam", + "type": "ExistsTypeAnnotation", "start": 26, "end": 27, "loc": { @@ -190,4 +190,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/flow/type-parameter-declaration/default/expected.json b/test/fixtures/flow/type-parameter-declaration/default/expected.json index 32f556fd7e..e428993128 100644 --- a/test/fixtures/flow/type-parameter-declaration/default/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/default/expected.json @@ -200,7 +200,7 @@ }, "name": "T", "default": { - "type": "ExistentialTypeParam", + "type": "ExistsTypeAnnotation", "start": 34, "end": 35, "loc": { @@ -3237,4 +3237,4 @@ ], "directives": [] } -} \ No newline at end of file +} From e614032504f0add8e945e5079a294ba9a883ab41 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Fri, 27 Jan 2017 23:08:20 +0100 Subject: [PATCH 009/105] Change location of ObjectTypeIndexer to match flow (#228) --- src/plugins/flow.js | 5 ++++- .../flow/interfaces-module-and-script/5/expected.json | 6 +++--- test/fixtures/flow/type-annotations/41/expected.json | 10 +++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 3aa7323e3e..edfff21b9e 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -282,8 +282,11 @@ pp.flowParseObjectTypeIndexer = function (node, isStatic, variance) { node.value = this.flowParseTypeInitialiser(); node.variance = variance; + // Finish node first to not include a possible semicolon in the locations + const indexer = this.finishNode(node, "ObjectTypeIndexer"); this.flowObjectTypeSemicolon(); - return this.finishNode(node, "ObjectTypeIndexer"); + + return indexer; }; pp.flowParseObjectTypeMethodish = function (node) { diff --git a/test/fixtures/flow/interfaces-module-and-script/5/expected.json b/test/fixtures/flow/interfaces-module-and-script/5/expected.json index 23bbe6bc92..946ad67dca 100644 --- a/test/fixtures/flow/interfaces-module-and-script/5/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/5/expected.json @@ -129,7 +129,7 @@ { "type": "ObjectTypeIndexer", "start": 23, - "end": 47, + "end": 46, "loc": { "start": { "line": 1, @@ -137,7 +137,7 @@ }, "end": { "line": 1, - "column": 47 + "column": 46 } }, "id": { @@ -194,4 +194,4 @@ ] }, "comments": [] -} \ No newline at end of file +} diff --git a/test/fixtures/flow/type-annotations/41/expected.json b/test/fixtures/flow/type-annotations/41/expected.json index 11f1b5529a..7db814ba65 100644 --- a/test/fixtures/flow/type-annotations/41/expected.json +++ b/test/fixtures/flow/type-annotations/41/expected.json @@ -106,7 +106,7 @@ { "type": "ObjectTypeIndexer", "start": 9, - "end": 29, + "end": 28, "loc": { "start": { "line": 1, @@ -114,7 +114,7 @@ }, "end": { "line": 1, - "column": 29 + "column": 28 } }, "id": { @@ -167,7 +167,7 @@ { "type": "ObjectTypeIndexer", "start": 30, - "end": 50, + "end": 49, "loc": { "start": { "line": 1, @@ -175,7 +175,7 @@ }, "end": { "line": 1, - "column": 50 + "column": 49 } }, "id": { @@ -238,4 +238,4 @@ ] }, "comments": [] -} \ No newline at end of file +} From b0220bfd3ee99b33620ea2855abe4b7d6eedba7f Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 9 Feb 2017 14:30:19 +0100 Subject: [PATCH 010/105] chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b2b2d855d9..9c2c66a5ae 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "babel-eslint": "^7.0.0", "babel-helper-fixtures": "^6.9.0", "babel-plugin-external-helpers": "^6.18.0", - "babel-plugin-istanbul": "^3.0.0", + "babel-plugin-istanbul": "^4.0.0", "babel-plugin-transform-flow-strip-types": "^6.14.0", "babel-preset-es2015": "^6.14.0", "babel-preset-stage-0": "^6.5.0", From 0834cb5b72e2a1fdfcb1bbcf13bf60dbb47ee4d7 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 9 Feb 2017 14:55:55 +0100 Subject: [PATCH 011/105] chore(package): update ava to version 0.18.0 (#345) https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9c2c66a5ae..1502f30eef 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "node": ">=4.2.0" }, "devDependencies": { - "ava": "^0.17.0", + "ava": "^0.18.0", "babel-cli": "^6.14.0", "babel-eslint": "^7.0.0", "babel-helper-fixtures": "^6.9.0", From 56928dca662435d1234931cb0cd8a284e29ac9d3 Mon Sep 17 00:00:00 2001 From: Brandon Dail Date: Thu, 9 Feb 2017 16:37:03 -0600 Subject: [PATCH 012/105] [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) * Remove ForAwaitStatement, add await flag to ForOfStatement * Set await flag for all ForOfStatements --- ast/spec.md | 12 +----------- src/parser/statement.js | 5 ++--- .../esprima/es2015-for-of/for-of/expected.json | 1 + .../async-generators/for-await/expected.json | 3 ++- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/ast/spec.md b/ast/spec.md index 346b7b95aa..2b57c89eac 100644 --- a/ast/spec.md +++ b/ast/spec.md @@ -35,7 +35,6 @@ These are the core Babylon AST node types. - [ForStatement](#forstatement) - [ForInStatement](#forinstatement) - [ForOfStatement](#forofstatement) - - [ForAwaitStatement](#forawaitstatement) - [Declarations](#declarations) - [FunctionDeclaration](#functiondeclaration) - [VariableDeclaration](#variabledeclaration) @@ -478,16 +477,7 @@ A `for`/`in` statement. ```js interface ForOfStatement <: ForInStatement { type: "ForOfStatement"; -} -``` - -A `for`/`await` statement. - -## ForAwaitStatement - -```js -interface ForAwaitStatement <: ForInStatement { - type: "ForAwaitStatement"; + await: boolean; } ``` diff --git a/src/parser/statement.js b/src/parser/statement.js index a26d3a9a0b..7194a555d7 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -530,14 +530,13 @@ pp.parseFor = function (node, init) { // same from parser's perspective. pp.parseForIn = function (node, init, forAwait) { - let type; + const type = this.match(tt._in) ? "ForInStatement" : "ForOfStatement"; if (forAwait) { this.eatContextual("of"); - type = "ForAwaitStatement"; } else { - type = this.match(tt._in) ? "ForInStatement" : "ForOfStatement"; this.next(); } + node.await = !!forAwait; node.left = init; node.right = this.parseExpression(); this.expect(tt.parenR); diff --git a/test/fixtures/esprima/es2015-for-of/for-of/expected.json b/test/fixtures/esprima/es2015-for-of/for-of/expected.json index 32de26d7ac..8b229f61b2 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of/expected.json @@ -32,6 +32,7 @@ "type": "ForOfStatement", "start": 0, "end": 13, + "await": false, "loc": { "start": { "line": 1, diff --git a/test/fixtures/experimental/async-generators/for-await/expected.json b/test/fixtures/experimental/async-generators/for-await/expected.json index 1551481f51..273efee728 100644 --- a/test/fixtures/experimental/async-generators/for-await/expected.json +++ b/test/fixtures/experimental/async-generators/for-await/expected.json @@ -78,7 +78,7 @@ }, "body": [ { - "type": "ForAwaitStatement", + "type": "ForOfStatement", "start": 23, "end": 46, "loc": { @@ -91,6 +91,7 @@ "column": 25 } }, + "await": true, "left": { "type": "VariableDeclaration", "start": 34, From cd3f14921e2f1e47c64d8aca3d9b9c07562b7dc9 Mon Sep 17 00:00:00 2001 From: Charles Pick Date: Sun, 12 Feb 2017 12:14:35 +0000 Subject: [PATCH 013/105] Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) --- src/plugins/flow.js | 4 ++-- .../good_05/expected.json | 2 +- .../flow/anonymous-function-types/good_10/expected.json | 2 +- .../flow/anonymous-function-types/good_13/expected.json | 2 +- .../flow/anonymous-function-types/good_14/expected.json | 4 ++-- .../flow/literal-types/number-binary/expected.json | 2 +- .../flow/literal-types/number-float/expected.json | 2 +- .../flow/literal-types/number-integer/expected.json | 2 +- .../literal-types/number-negative-binary/expected.json | 2 +- .../literal-types/number-negative-float/expected.json | 2 +- .../literal-types/number-negative-octal-2/expected.json | 2 +- .../literal-types/number-negative-octal/expected.json | 2 +- .../flow/literal-types/number-octal-2/expected.json | 2 +- .../flow/literal-types/number-octal/expected.json | 2 +- test/fixtures/flow/type-annotations/129/expected.json | 4 ++-- test/fixtures/flow/type-annotations/130/expected.json | 8 ++++---- test/fixtures/flow/type-annotations/builtin/expected.json | 2 +- .../negative-number-literal/expected.json | 6 +++--- 18 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 0b1f851db0..96dcad9d66 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -687,7 +687,7 @@ pp.flowParsePrimaryType = function () { this.addExtra(node, "rawValue", node.value); this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end)); this.next(); - return this.finishNode(node, "NumericLiteralTypeAnnotation"); + return this.finishNode(node, "NumberLiteralTypeAnnotation"); } case tt.num: @@ -695,7 +695,7 @@ pp.flowParsePrimaryType = function () { this.addExtra(node, "rawValue", node.value); this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end)); this.next(); - return this.finishNode(node, "NumericLiteralTypeAnnotation"); + return this.finishNode(node, "NumberLiteralTypeAnnotation"); case tt._null: node.value = this.match(tt._null); diff --git a/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json b/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json index 073bb795bf..94ac983cb5 100644 --- a/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json +++ b/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json @@ -164,7 +164,7 @@ ], "rest": null, "returnType": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 24, "end": 27, "loc": { diff --git a/test/fixtures/flow/anonymous-function-types/good_10/expected.json b/test/fixtures/flow/anonymous-function-types/good_10/expected.json index e522809a4c..ffb3d792e6 100644 --- a/test/fixtures/flow/anonymous-function-types/good_10/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_10/expected.json @@ -168,7 +168,7 @@ ], "rest": null, "returnType": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 28, "end": 31, "loc": { diff --git a/test/fixtures/flow/anonymous-function-types/good_13/expected.json b/test/fixtures/flow/anonymous-function-types/good_13/expected.json index 0448cdbd22..829f2cc872 100644 --- a/test/fixtures/flow/anonymous-function-types/good_13/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_13/expected.json @@ -158,7 +158,7 @@ ], "rest": null, "returnType": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 26, "end": 29, "loc": { diff --git a/test/fixtures/flow/anonymous-function-types/good_14/expected.json b/test/fixtures/flow/anonymous-function-types/good_14/expected.json index 3aa12410f0..72b991f723 100644 --- a/test/fixtures/flow/anonymous-function-types/good_14/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_14/expected.json @@ -118,7 +118,7 @@ }, "types": [ { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 15, "end": 16, "loc": { @@ -138,7 +138,7 @@ } }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 19, "end": 20, "loc": { diff --git a/test/fixtures/flow/literal-types/number-binary/expected.json b/test/fixtures/flow/literal-types/number-binary/expected.json index 44d455a56d..2f0fde7e23 100644 --- a/test/fixtures/flow/literal-types/number-binary/expected.json +++ b/test/fixtures/flow/literal-types/number-binary/expected.json @@ -87,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 16, "loc": { diff --git a/test/fixtures/flow/literal-types/number-float/expected.json b/test/fixtures/flow/literal-types/number-float/expected.json index 4cdb637a55..3b07b2d152 100644 --- a/test/fixtures/flow/literal-types/number-float/expected.json +++ b/test/fixtures/flow/literal-types/number-float/expected.json @@ -87,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 12, "loc": { diff --git a/test/fixtures/flow/literal-types/number-integer/expected.json b/test/fixtures/flow/literal-types/number-integer/expected.json index 9b9a6da608..dd2263c75e 100644 --- a/test/fixtures/flow/literal-types/number-integer/expected.json +++ b/test/fixtures/flow/literal-types/number-integer/expected.json @@ -87,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 10, "loc": { diff --git a/test/fixtures/flow/literal-types/number-negative-binary/expected.json b/test/fixtures/flow/literal-types/number-negative-binary/expected.json index 44d455a56d..2f0fde7e23 100644 --- a/test/fixtures/flow/literal-types/number-negative-binary/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-binary/expected.json @@ -87,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 16, "loc": { diff --git a/test/fixtures/flow/literal-types/number-negative-float/expected.json b/test/fixtures/flow/literal-types/number-negative-float/expected.json index 735c2e093f..9d7ecefb77 100644 --- a/test/fixtures/flow/literal-types/number-negative-float/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-float/expected.json @@ -87,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 13, "loc": { diff --git a/test/fixtures/flow/literal-types/number-negative-octal-2/expected.json b/test/fixtures/flow/literal-types/number-negative-octal-2/expected.json index 489e2faac9..06ef646088 100644 --- a/test/fixtures/flow/literal-types/number-negative-octal-2/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-octal-2/expected.json @@ -87,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 13, "loc": { diff --git a/test/fixtures/flow/literal-types/number-negative-octal/expected.json b/test/fixtures/flow/literal-types/number-negative-octal/expected.json index 2ac2c96235..dd0a65307c 100644 --- a/test/fixtures/flow/literal-types/number-negative-octal/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-octal/expected.json @@ -87,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 12, "loc": { diff --git a/test/fixtures/flow/literal-types/number-octal-2/expected.json b/test/fixtures/flow/literal-types/number-octal-2/expected.json index 7c7b41adc3..f57f036c6e 100644 --- a/test/fixtures/flow/literal-types/number-octal-2/expected.json +++ b/test/fixtures/flow/literal-types/number-octal-2/expected.json @@ -87,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 12, "loc": { diff --git a/test/fixtures/flow/literal-types/number-octal/expected.json b/test/fixtures/flow/literal-types/number-octal/expected.json index 608b0731b2..bd69b4d140 100644 --- a/test/fixtures/flow/literal-types/number-octal/expected.json +++ b/test/fixtures/flow/literal-types/number-octal/expected.json @@ -87,7 +87,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 11, "loc": { diff --git a/test/fixtures/flow/type-annotations/129/expected.json b/test/fixtures/flow/type-annotations/129/expected.json index e55c90e118..d5fd461dfe 100644 --- a/test/fixtures/flow/type-annotations/129/expected.json +++ b/test/fixtures/flow/type-annotations/129/expected.json @@ -103,7 +103,7 @@ }, "types": [ { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 10, "end": 11, "loc": { @@ -123,7 +123,7 @@ } }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 15, "end": 16, "loc": { diff --git a/test/fixtures/flow/type-annotations/130/expected.json b/test/fixtures/flow/type-annotations/130/expected.json index 2a823858a4..26a0c561a6 100644 --- a/test/fixtures/flow/type-annotations/130/expected.json +++ b/test/fixtures/flow/type-annotations/130/expected.json @@ -109,7 +109,7 @@ }, "types": [ { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 16, "end": 17, "loc": { @@ -129,7 +129,7 @@ } }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 20, "end": 21, "loc": { @@ -198,7 +198,7 @@ }, "types": [ { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 28, "end": 29, "loc": { @@ -218,7 +218,7 @@ } }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 32, "end": 33, "loc": { diff --git a/test/fixtures/flow/type-annotations/builtin/expected.json b/test/fixtures/flow/type-annotations/builtin/expected.json index 8c51c73f05..189484fe9d 100644 --- a/test/fixtures/flow/type-annotations/builtin/expected.json +++ b/test/fixtures/flow/type-annotations/builtin/expected.json @@ -637,7 +637,7 @@ }, "typeParameters": null, "right": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 215, "end": 216, "loc": { diff --git a/test/fixtures/flow/type-annotations/negative-number-literal/expected.json b/test/fixtures/flow/type-annotations/negative-number-literal/expected.json index e4b1cc8f02..3d3cc852fc 100644 --- a/test/fixtures/flow/type-annotations/negative-number-literal/expected.json +++ b/test/fixtures/flow/type-annotations/negative-number-literal/expected.json @@ -76,7 +76,7 @@ }, "types": [ { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 45, "end": 47, "loc": { @@ -96,7 +96,7 @@ } }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 52, "end": 53, "loc": { @@ -116,7 +116,7 @@ } }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 58, "end": 59, "loc": { From 1cca7000d1f4ab2db6bb3662d778f7efd4b1fa1a Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 12 Feb 2017 13:28:14 +0100 Subject: [PATCH 014/105] Reintroduce Variance node (#333) * Reintroduce Variance node * Optimize code and coverage tt.plusMin can only be + or - so no need to have an elseif --- src/plugins/flow.js | 22 ++-- .../flow/def-site-variance/1/expected.json | 102 ++++++++++++++++-- .../flow/type-annotations/110/expected.json | 17 ++- .../flow/type-annotations/111/expected.json | 17 ++- .../flow/type-annotations/114/expected.json | 17 ++- .../flow/type-annotations/115/expected.json | 17 ++- .../flow/type-annotations/118/expected.json | 19 +++- .../flow/type-annotations/119/expected.json | 19 +++- 8 files changed, 203 insertions(+), 27 deletions(-) diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 96dcad9d66..5d34485add 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -400,14 +400,13 @@ pp.flowParseObjectType = function (allowStatic, allowExact) { isStatic = true; } - const variancePos = this.state.start; const variance = this.flowParseVariance(); if (this.match(tt.bracketL)) { nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); } else if (this.match(tt.parenL) || this.isRelational("<")) { if (variance) { - this.unexpected(variancePos); + this.unexpected(variance.start); } nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); } else { @@ -415,7 +414,7 @@ pp.flowParseObjectType = function (allowStatic, allowExact) { if (this.isRelational("<") || this.match(tt.parenL)) { // This is a method property if (variance) { - this.unexpected(variancePos); + this.unexpected(variance.start); } nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey)); } else { @@ -815,12 +814,14 @@ pp.typeCastToParameter = function (node) { pp.flowParseVariance = function() { let variance = null; if (this.match(tt.plusMin)) { + variance = this.startNode(); if (this.state.value === "+") { - variance = "plus"; - } else if (this.state.value === "-") { - variance = "minus"; + variance.kind = "plus"; + } else { + variance.kind = "minus"; } this.next(); + this.finishNode(variance, "Variance"); } return variance; }; @@ -1069,7 +1070,6 @@ export default function (instance) { // parse class property type annotations instance.extend("parseClassProperty", function (inner) { return function (node) { - delete node.variancePos; if (this.match(tt.colon)) { node.typeAnnotation = this.flowParseTypeAnnotation(); } @@ -1088,10 +1088,9 @@ export default function (instance) { instance.extend("parseClassMethod", function (inner) { return function (classBody, method, ...args) { if (method.variance) { - this.unexpected(method.variancePos); + this.unexpected(method.variance.start); } delete method.variance; - delete method.variancePos; if (this.isRelational("<")) { method.typeParameters = this.flowParseTypeParameterDeclaration(); } @@ -1126,11 +1125,9 @@ export default function (instance) { instance.extend("parsePropertyName", function (inner) { return function (node) { - const variancePos = this.state.start; const variance = this.flowParseVariance(); const key = inner.call(this, node); node.variance = variance; - node.variancePos = variancePos; return key; }; }); @@ -1139,10 +1136,9 @@ export default function (instance) { instance.extend("parseObjPropValue", function (inner) { return function (prop) { if (prop.variance) { - this.unexpected(prop.variancePos); + this.unexpected(prop.variance.start); } delete prop.variance; - delete prop.variancePos; let typeParameters; diff --git a/test/fixtures/flow/def-site-variance/1/expected.json b/test/fixtures/flow/def-site-variance/1/expected.json index ad7acee460..d5e8a1b7b6 100644 --- a/test/fixtures/flow/def-site-variance/1/expected.json +++ b/test/fixtures/flow/def-site-variance/1/expected.json @@ -87,7 +87,22 @@ "column": 10 } }, - "variance": "plus", + "variance": { + "type": "Variance", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "kind": "plus" + }, "name": "T" }, { @@ -104,7 +119,22 @@ "column": 13 } }, - "variance": "minus", + "variance": { + "type": "Variance", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "kind": "minus" + }, "name": "U" } ] @@ -189,7 +219,22 @@ "column": 13 } }, - "variance": "plus", + "variance": { + "type": "Variance", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "kind": "plus" + }, "name": "T" }, { @@ -206,7 +251,22 @@ "column": 16 } }, - "variance": "minus", + "variance": { + "type": "Variance", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "kind": "minus" + }, "name": "U" } ] @@ -289,7 +349,22 @@ "column": 9 } }, - "variance": "plus", + "variance": { + "type": "Variance", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "kind": "plus" + }, "name": "T" }, { @@ -306,7 +381,22 @@ "column": 12 } }, - "variance": "minus", + "variance": { + "type": "Variance", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "kind": "minus" + }, "name": "U" } ] diff --git a/test/fixtures/flow/type-annotations/110/expected.json b/test/fixtures/flow/type-annotations/110/expected.json index 6556914731..813e1eb0d2 100644 --- a/test/fixtures/flow/type-annotations/110/expected.json +++ b/test/fixtures/flow/type-annotations/110/expected.json @@ -142,7 +142,22 @@ }, "optional": false, "static": false, - "variance": "plus" + "variance": { + "type": "Variance", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "kind": "plus" + } } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/111/expected.json b/test/fixtures/flow/type-annotations/111/expected.json index 8dde23737d..e8d4f2f2c1 100644 --- a/test/fixtures/flow/type-annotations/111/expected.json +++ b/test/fixtures/flow/type-annotations/111/expected.json @@ -142,7 +142,22 @@ }, "optional": false, "static": false, - "variance": "minus" + "variance": { + "type": "Variance", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "kind": "minus" + } } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/114/expected.json b/test/fixtures/flow/type-annotations/114/expected.json index 6279284056..4a29dfbbee 100644 --- a/test/fixtures/flow/type-annotations/114/expected.json +++ b/test/fixtures/flow/type-annotations/114/expected.json @@ -175,7 +175,22 @@ "name": "V" } }, - "variance": "plus" + "variance": { + "type": "Variance", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "kind": "plus" + } } ], "exact": false diff --git a/test/fixtures/flow/type-annotations/115/expected.json b/test/fixtures/flow/type-annotations/115/expected.json index 2ed71ae23e..7868c1e169 100644 --- a/test/fixtures/flow/type-annotations/115/expected.json +++ b/test/fixtures/flow/type-annotations/115/expected.json @@ -175,7 +175,22 @@ "name": "V" } }, - "variance": "minus" + "variance": { + "type": "Variance", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "kind": "minus" + } } ], "exact": false diff --git a/test/fixtures/flow/type-annotations/118/expected.json b/test/fixtures/flow/type-annotations/118/expected.json index 3197ff95a7..6b123d102a 100644 --- a/test/fixtures/flow/type-annotations/118/expected.json +++ b/test/fixtures/flow/type-annotations/118/expected.json @@ -107,7 +107,22 @@ }, "name": "p" }, - "variance": "plus", + "variance": { + "type": "Variance", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "kind": "plus" + }, "static": false, "typeAnnotation": { "type": "TypeAnnotation", @@ -165,4 +180,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/119/expected.json b/test/fixtures/flow/type-annotations/119/expected.json index 601ec1663f..3fb9fb001a 100644 --- a/test/fixtures/flow/type-annotations/119/expected.json +++ b/test/fixtures/flow/type-annotations/119/expected.json @@ -107,7 +107,22 @@ }, "name": "p" }, - "variance": "minus", + "variance": { + "type": "Variance", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "kind": "minus" + }, "static": false, "typeAnnotation": { "type": "TypeAnnotation", @@ -165,4 +180,4 @@ ], "directives": [] } -} +} \ No newline at end of file From 09c1f069f9c3957e0bcbcfb566d7d2809cc55978 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 12 Feb 2017 15:38:11 +0100 Subject: [PATCH 015/105] Fix test --- test/fixtures/flow/predicates/6/expected.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/flow/predicates/6/expected.json b/test/fixtures/flow/predicates/6/expected.json index 0805a80bd3..f6603c9dc0 100644 --- a/test/fixtures/flow/predicates/6/expected.json +++ b/test/fixtures/flow/predicates/6/expected.json @@ -178,7 +178,7 @@ }, "params": [ { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 39, "end": 40, "loc": { From d2ccc6ae228e1204c269a5b4d602edfea2830d50 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 12 Feb 2017 15:39:52 +0100 Subject: [PATCH 016/105] Fix test --- test/fixtures/flow/predicates/6/expected.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/flow/predicates/6/expected.json b/test/fixtures/flow/predicates/6/expected.json index f6603c9dc0..b4dc60f2be 100644 --- a/test/fixtures/flow/predicates/6/expected.json +++ b/test/fixtures/flow/predicates/6/expected.json @@ -530,7 +530,7 @@ } }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 82, "end": 83, "loc": { From 401733d19ff8b24e262fc21c27c4c0e534f453ea Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 15 Feb 2017 14:28:29 -0500 Subject: [PATCH 017/105] 7.0.0-beta.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1502f30eef..cb831d4765 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "6.15.0", + "version": "7.0.0-beta.0", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From e52962f4c94f3ba4f8ad84bb93ad959e367e2b19 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 20 Feb 2017 23:11:47 +0100 Subject: [PATCH 018/105] upgrade yarn.lock --- yarn.lock | 1533 +++++++++++++++++++++++++++++------------------------ 1 file changed, 833 insertions(+), 700 deletions(-) diff --git a/yarn.lock b/yarn.lock index dd45cf8ffc..ff0d82e2c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,9 +2,41 @@ # yarn lockfile v1 +"@ava/babel-preset-stage-4@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@ava/babel-preset-stage-4/-/babel-preset-stage-4-1.0.0.tgz#a613b5e152f529305422546b072d47facfb26291" + dependencies: + babel-plugin-check-es2015-constants "^6.8.0" + babel-plugin-syntax-trailing-function-commas "^6.20.0" + babel-plugin-transform-async-to-generator "^6.16.0" + babel-plugin-transform-es2015-destructuring "^6.19.0" + babel-plugin-transform-es2015-function-name "^6.9.0" + babel-plugin-transform-es2015-modules-commonjs "^6.18.0" + babel-plugin-transform-es2015-parameters "^6.21.0" + babel-plugin-transform-es2015-spread "^6.8.0" + babel-plugin-transform-es2015-sticky-regex "^6.8.0" + babel-plugin-transform-es2015-unicode-regex "^6.11.0" + babel-plugin-transform-exponentiation-operator "^6.8.0" + package-hash "^1.2.0" + +"@ava/babel-preset-transform-test-files@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@ava/babel-preset-transform-test-files/-/babel-preset-transform-test-files-2.0.1.tgz#d75232cc6d71dc9c7eae4b76a9004fd81501d0c1" + dependencies: + babel-plugin-ava-throws-helper "^1.0.0" + babel-plugin-espower "^2.3.2" + package-hash "^1.2.0" + +"@ava/pretty-format@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@ava/pretty-format/-/pretty-format-1.1.0.tgz#d0a57d25eb9aeab9643bdd1a030642b91c123e28" + dependencies: + ansi-styles "^2.2.1" + esutils "^2.0.2" + abbrev@1: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + version "1.1.0" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" acorn-jsx@^3.0.0: version "3.0.1" @@ -12,21 +44,21 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" +acorn@4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" + acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^4.0.1: - version "4.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" - ajv-keywords@^1.0.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.0.tgz#c11e6859eafff83e0dafc416929472eca946aa2c" + version "1.5.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" ajv@^4.7.0: - version "4.10.4" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.10.4.tgz#c0974dd00b3464984892d6010aa9c2c945933254" + version "4.11.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.3.tgz#ce30bdb90d1254f762c75af915fb3a63e7183d22" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" @@ -79,8 +111,8 @@ append-transform@^0.4.0: default-require-extensions "^1.0.0" aproba@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0" + version "1.1.1" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab" archy@^1.0.0: version "1.0.0" @@ -171,109 +203,94 @@ asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" -auto-bind@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-0.1.0.tgz#7a29efc8c2388d3d578e02fc2df531c81ffc1ee1" +auto-bind@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-1.1.0.tgz#93b864dc7ee01a326281775d5c75ca0a751e5961" -ava-files@^0.2.0: +ava-init@^0.2.0: version "0.2.0" - resolved "https://registry.yarnpkg.com/ava-files/-/ava-files-0.2.0.tgz#c7b8b6e2e0cea63b57a6e27e0db145c7c19cfe20" - dependencies: - auto-bind "^0.1.0" - bluebird "^3.4.1" - globby "^6.0.0" - ignore-by-default "^1.0.1" - lodash.flatten "^4.2.0" - multimatch "^2.1.0" - slash "^1.0.0" - -ava-init@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ava-init/-/ava-init-0.1.6.tgz#ef19ed0b24b6bf359dad6fbadf1a05d836395c91" + resolved "https://registry.yarnpkg.com/ava-init/-/ava-init-0.2.0.tgz#9304c8b4c357d66e3dfdae1fbff47b1199d5c55d" dependencies: arr-exclude "^1.0.0" - cross-spawn "^4.0.0" - pinkie-promise "^2.0.0" - read-pkg-up "^1.0.1" - the-argv "^1.0.0" - write-pkg "^1.0.0" - -ava@^0.17.0: - version "0.17.0" - resolved "https://registry.yarnpkg.com/ava/-/ava-0.17.0.tgz#359e2a89616801ef03929c3cf10a9d4f8e451d02" - dependencies: + execa "^0.5.0" + has-yarn "^1.0.0" + read-pkg-up "^2.0.0" + write-pkg "^2.0.0" + +ava@^0.18.0: + version "0.18.2" + resolved "https://registry.yarnpkg.com/ava/-/ava-0.18.2.tgz#79253d1636077034a2780bb55b5c3e6c3d7f312f" + dependencies: + "@ava/babel-preset-stage-4" "^1.0.0" + "@ava/babel-preset-transform-test-files" "^2.0.0" + "@ava/pretty-format" "^1.1.0" arr-flatten "^1.0.1" array-union "^1.0.1" array-uniq "^1.0.2" arrify "^1.0.0" - auto-bind "^0.1.0" - ava-files "^0.2.0" - ava-init "^0.1.0" + auto-bind "^1.1.0" + ava-init "^0.2.0" babel-code-frame "^6.16.0" babel-core "^6.17.0" - babel-plugin-ava-throws-helper "^0.1.0" - babel-plugin-detective "^2.0.0" - babel-plugin-espower "^2.3.1" - babel-plugin-transform-runtime "^6.15.0" - babel-preset-es2015 "^6.16.0" - babel-preset-es2015-node4 "^2.1.0" - babel-preset-stage-2 "^6.17.0" - babel-runtime "^6.11.6" bluebird "^3.0.0" caching-transform "^1.0.0" chalk "^1.0.0" chokidar "^1.4.2" + clean-stack "^1.1.1" clean-yaml-object "^0.1.0" - cli-cursor "^1.0.2" - cli-spinners "^0.1.2" + cli-cursor "^2.1.0" + cli-spinners "^1.0.0" cli-truncate "^0.2.0" co-with-promise "^4.6.0" + code-excerpt "^2.1.0" common-path-prefix "^1.0.0" convert-source-map "^1.2.0" core-assert "^0.2.0" currently-unhandled "^0.4.1" debug "^2.2.0" + diff "^3.0.1" + dot-prop "^4.1.0" empower-core "^0.6.1" - figures "^1.4.0" + equal-length "^1.0.0" + figures "^2.0.0" find-cache-dir "^0.1.1" fn-name "^2.0.0" get-port "^2.1.0" + globby "^6.0.0" has-flag "^2.0.0" ignore-by-default "^1.0.0" + indent-string "^3.0.0" is-ci "^1.0.7" is-generator-fn "^1.0.0" is-obj "^1.0.0" is-observable "^0.2.0" is-promise "^2.1.0" + jest-snapshot "^18.1.0" last-line-stream "^1.0.0" lodash.debounce "^4.0.3" lodash.difference "^4.3.0" - lodash.isequal "^4.4.0" + lodash.flatten "^4.2.0" + lodash.isequal "^4.5.0" loud-rejection "^1.2.0" matcher "^0.1.1" max-timeout "^1.0.0" - md5-hex "^1.2.0" + md5-hex "^2.0.0" meow "^3.7.0" ms "^0.7.1" - object-assign "^4.0.1" + multimatch "^2.1.0" observable-to-promise "^0.4.0" option-chain "^0.1.0" - package-hash "^1.1.0" - pkg-conf "^1.0.1" + package-hash "^1.2.0" + pkg-conf "^2.0.0" plur "^2.0.0" - power-assert-context-formatter "^1.0.4" - power-assert-renderer-assertion "^1.0.1" - power-assert-renderer-succinct "^1.0.1" pretty-ms "^2.0.0" - repeating "^2.0.0" require-precompiled "^0.1.0" resolve-cwd "^1.0.0" - semver "^5.3.0" - set-immediate-shim "^1.0.1" + slash "^1.0.0" source-map-support "^0.4.0" - stack-utils "^0.4.0" + stack-utils "^1.0.0" strip-ansi "^3.0.1" - strip-bom "^2.0.0" + strip-bom-buf "^1.0.0" time-require "^0.1.2" unique-temp-dir "^1.0.0" update-notifier "^1.0.0" @@ -283,21 +300,21 @@ aws-sign2@~0.6.0: resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" aws4@^1.2.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755" + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" babel-cli@^6.14.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.18.0.tgz#92117f341add9dead90f6fa7d0a97c0cc08ec186" + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.23.0.tgz#52ff946a2b0f64645c35e7bd5eea267aa0948c0f" dependencies: - babel-core "^6.18.0" - babel-polyfill "^6.16.0" - babel-register "^6.18.0" - babel-runtime "^6.9.0" + babel-core "^6.23.0" + babel-polyfill "^6.23.0" + babel-register "^6.23.0" + babel-runtime "^6.22.0" commander "^2.8.1" convert-source-map "^1.1.0" fs-readdir-recursive "^1.0.0" - glob "^5.0.5" + glob "^7.0.0" lodash "^4.2.0" output-file-sync "^1.1.0" path-is-absolute "^1.0.0" @@ -305,29 +322,29 @@ babel-cli@^6.14.0: source-map "^0.5.0" v8flags "^2.0.10" optionalDependencies: - chokidar "^1.0.0" + chokidar "^1.6.1" -babel-code-frame@^6.16.0, babel-code-frame@^6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.20.0.tgz#b968f839090f9a8bc6d41938fb96cb84f7387b26" +babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: chalk "^1.1.0" esutils "^2.0.2" - js-tokens "^2.0.0" - -babel-core@6, babel-core@^6.17.0, babel-core@^6.18.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.21.0.tgz#75525480c21c803f826ef3867d22c19f080a3724" - dependencies: - babel-code-frame "^6.20.0" - babel-generator "^6.21.0" - babel-helpers "^6.16.0" - babel-messages "^6.8.0" - babel-register "^6.18.0" - babel-runtime "^6.20.0" - babel-template "^6.16.0" - babel-traverse "^6.21.0" - babel-types "^6.21.0" + js-tokens "^3.0.0" + +babel-core@6, babel-core@^6.17.0, babel-core@^6.23.0: + version "6.23.1" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.23.1.tgz#c143cb621bb2f621710c220c5d579d15b8a442df" + dependencies: + babel-code-frame "^6.22.0" + babel-generator "^6.23.0" + babel-helpers "^6.23.0" + babel-messages "^6.23.0" + babel-register "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.1" + babel-types "^6.23.0" babylon "^6.11.0" convert-source-map "^1.1.0" debug "^2.1.1" @@ -349,168 +366,165 @@ babel-eslint@^7.0.0: babylon "^6.13.0" lodash.pickby "^4.6.0" -babel-generator@^6.1.0, babel-generator@^6.18.0, babel-generator@^6.21.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.21.0.tgz#605f1269c489a1c75deeca7ea16d43d4656c8494" +babel-generator@^6.1.0, babel-generator@^6.18.0, babel-generator@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.23.0.tgz#6b8edab956ef3116f79d8c84c5a3c05f32a74bc5" dependencies: - babel-messages "^6.8.0" - babel-runtime "^6.20.0" - babel-types "^6.21.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" detect-indent "^4.0.0" jsesc "^1.3.0" lodash "^4.2.0" source-map "^0.5.0" + trim-right "^1.0.1" -babel-helper-bindify-decorators@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.18.0.tgz#fc00c573676a6e702fffa00019580892ec8780a5" +babel-helper-bindify-decorators@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.22.0.tgz#d7f5bc261275941ac62acfc4e20dacfb8a3fe952" dependencies: - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-builder-binary-assignment-operator-visitor@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.18.0.tgz#8ae814989f7a53682152e3401a04fabd0bb333a6" +babel-helper-builder-binary-assignment-operator-visitor@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.22.0.tgz#29df56be144d81bdeac08262bfa41d2c5e91cdcd" dependencies: - babel-helper-explode-assignable-expression "^6.18.0" - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-helper-explode-assignable-expression "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-helper-call-delegate@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.18.0.tgz#05b14aafa430884b034097ef29e9f067ea4133bd" +babel-helper-call-delegate@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz#119921b56120f17e9dae3f74b4f5cc7bcc1b37ef" dependencies: - babel-helper-hoist-variables "^6.18.0" - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-hoist-variables "^6.22.0" + babel-runtime "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-define-map@^6.18.0, babel-helper-define-map@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.18.0.tgz#8d6c85dc7fbb4c19be3de40474d18e97c3676ec2" +babel-helper-define-map@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz#1444f960c9691d69a2ced6a205315f8fd00804e7" dependencies: - babel-helper-function-name "^6.18.0" - babel-runtime "^6.9.0" - babel-types "^6.18.0" + babel-helper-function-name "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" lodash "^4.2.0" -babel-helper-explode-assignable-expression@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.18.0.tgz#14b8e8c2d03ad735d4b20f1840b24cd1f65239fe" +babel-helper-explode-assignable-expression@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.22.0.tgz#c97bf76eed3e0bae4048121f2b9dae1a4e7d0478" dependencies: - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-explode-class@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.18.0.tgz#c44f76f4fa23b9c5d607cbac5d4115e7a76f62cb" +babel-helper-explode-class@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.22.0.tgz#646304924aa6388a516843ba7f1855ef8dfeb69b" dependencies: - babel-helper-bindify-decorators "^6.18.0" - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-bindify-decorators "^6.22.0" + babel-runtime "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" babel-helper-fixtures@^6.9.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-helper-fixtures/-/babel-helper-fixtures-6.20.0.tgz#b794c55077e4d5b969604a98cecad0068a7f16e8" + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-fixtures/-/babel-helper-fixtures-6.22.0.tgz#3cb9eaf5feae29f001d2754ab43b14a9dfa304ff" dependencies: - babel-runtime "^6.20.0" + babel-runtime "^6.22.0" lodash "^4.2.0" try-resolve "^1.0.0" -babel-helper-function-name@^6.18.0, babel-helper-function-name@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.18.0.tgz#68ec71aeba1f3e28b2a6f0730190b754a9bf30e6" +babel-helper-function-name@^6.22.0, babel-helper-function-name@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz#25742d67175c8903dbe4b6cb9d9e1fcb8dcf23a6" dependencies: - babel-helper-get-function-arity "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-get-function-arity "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-helper-get-function-arity@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.18.0.tgz#a5b19695fd3f9cdfc328398b47dafcd7094f9f24" +babel-helper-get-function-arity@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz#0beb464ad69dc7347410ac6ade9f03a50634f5ce" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-helper-hoist-variables@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.18.0.tgz#a835b5ab8b46d6de9babefae4d98ea41e866b82a" +babel-helper-hoist-variables@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz#3eacbf731d80705845dd2e9718f600cfb9b4ba72" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-helper-optimise-call-expression@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.18.0.tgz#9261d0299ee1a4f08a6dd28b7b7c777348fd8f0f" +babel-helper-optimise-call-expression@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz#f3ee7eed355b4282138b33d02b78369e470622f5" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" -babel-helper-regex@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.18.0.tgz#ae0ebfd77de86cb2f1af258e2cc20b5fe893ecc6" +babel-helper-regex@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz#79f532be1647b1f0ee3474b5f5c3da58001d247d" dependencies: - babel-runtime "^6.9.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" lodash "^4.2.0" -babel-helper-remap-async-to-generator@^6.16.0, babel-helper-remap-async-to-generator@^6.16.2: - version "6.20.3" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.20.3.tgz#9dd3b396f13e35ef63e538098500adc24c63c4e7" +babel-helper-remap-async-to-generator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.22.0.tgz#2186ae73278ed03b8b15ced089609da981053383" dependencies: - babel-helper-function-name "^6.18.0" - babel-runtime "^6.20.0" - babel-template "^6.16.0" - babel-traverse "^6.20.0" - babel-types "^6.20.0" + babel-helper-function-name "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-replace-supers@^6.18.0, babel-helper-replace-supers@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.18.0.tgz#28ec69877be4144dbd64f4cc3a337e89f29a924e" +babel-helper-replace-supers@^6.22.0, babel-helper-replace-supers@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz#eeaf8ad9b58ec4337ca94223bacdca1f8d9b4bfd" dependencies: - babel-helper-optimise-call-expression "^6.18.0" - babel-messages "^6.8.0" - babel-runtime "^6.0.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-optimise-call-expression "^6.23.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-helpers@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3" +babel-helpers@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.23.0.tgz#4f8f2e092d0b6a8808a4bde79c27f1e2ecf0d992" dependencies: - babel-runtime "^6.0.0" - babel-template "^6.16.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" -babel-messages@^6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.8.0.tgz#bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9" +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-ava-throws-helper@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-ava-throws-helper/-/babel-plugin-ava-throws-helper-0.1.0.tgz#951107708a12208026bf8ca4cef18a87bc9b0cfe" +babel-plugin-ava-throws-helper@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-ava-throws-helper/-/babel-plugin-ava-throws-helper-1.0.0.tgz#8fe6e79d2fd19838b5c3649f89cfb03fd563e241" dependencies: babel-template "^6.7.0" babel-types "^6.7.2" -babel-plugin-check-es2015-constants@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.8.0.tgz#dbf024c32ed37bfda8dee1e76da02386a8d26fe7" +babel-plugin-check-es2015-constants@^6.22.0, babel-plugin-check-es2015-constants@^6.8.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-detective@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-detective/-/babel-plugin-detective-2.0.0.tgz#6e642e83c22a335279754ebe2d754d2635f49f13" - -babel-plugin-espower@^2.3.1: +babel-plugin-espower@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/babel-plugin-espower/-/babel-plugin-espower-2.3.2.tgz#5516b8fcdb26c9f0e1d8160749f6e4c65e71271e" dependencies: @@ -523,19 +537,18 @@ babel-plugin-espower@^2.3.1: estraverse "^4.1.1" babel-plugin-external-helpers@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.18.0.tgz#c6bbf87a4448eb49616f24a8b8088503863488da" + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-istanbul@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-3.1.2.tgz#11d5abde18425ec24b5d648c7e0b5d25cd354a22" +babel-plugin-istanbul@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.0.0.tgz#36bde8fbef4837e5ff0366531a2beabd7b1ffa10" dependencies: - find-up "^1.1.2" + find-up "^2.1.0" istanbul-lib-instrument "^1.4.2" - object-assign "^4.1.0" - test-exclude "^3.3.0" + test-exclude "^4.0.0" babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" @@ -585,423 +598,402 @@ babel-plugin-syntax-object-rest-spread@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" -babel-plugin-syntax-trailing-function-commas@^6.3.13: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.20.0.tgz#442835e19179f45b87e92d477d70b9f1f18b5c4f" +babel-plugin-syntax-trailing-function-commas@^6.20.0, babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" -babel-plugin-transform-async-generator-functions@^6.17.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.17.0.tgz#d0b5a2b2f0940f2b245fa20a00519ed7bc6cae54" +babel-plugin-transform-async-generator-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.22.0.tgz#a720a98153a7596f204099cd5409f4b3c05bab46" dependencies: - babel-helper-remap-async-to-generator "^6.16.2" + babel-helper-remap-async-to-generator "^6.22.0" babel-plugin-syntax-async-generators "^6.5.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-async-to-generator@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.16.0.tgz#19ec36cb1486b59f9f468adfa42ce13908ca2999" +babel-plugin-transform-async-to-generator@^6.16.0, babel-plugin-transform-async-to-generator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.22.0.tgz#194b6938ec195ad36efc4c33a971acf00d8cd35e" dependencies: - babel-helper-remap-async-to-generator "^6.16.0" + babel-helper-remap-async-to-generator "^6.22.0" babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-class-constructor-call@^6.3.13: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.18.0.tgz#80855e38a1ab47b8c6c647f8ea1bcd2c00ca3aae" +babel-plugin-transform-class-constructor-call@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.22.0.tgz#11a4d2216abb5b0eef298b493748f4f2f4869120" dependencies: babel-plugin-syntax-class-constructor-call "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" -babel-plugin-transform-class-properties@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.19.0.tgz#1274b349abaadc835164e2004f4a2444a2788d5f" +babel-plugin-transform-class-properties@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.23.0.tgz#187b747ee404399013563c993db038f34754ac3b" dependencies: - babel-helper-function-name "^6.18.0" + babel-helper-function-name "^6.23.0" babel-plugin-syntax-class-properties "^6.8.0" - babel-runtime "^6.9.1" - babel-template "^6.15.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" -babel-plugin-transform-decorators@^6.13.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.13.0.tgz#82d65c1470ae83e2d13eebecb0a1c2476d62da9d" +babel-plugin-transform-decorators@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.22.0.tgz#c03635b27a23b23b7224f49232c237a73988d27c" dependencies: - babel-helper-define-map "^6.8.0" - babel-helper-explode-class "^6.8.0" + babel-helper-explode-class "^6.22.0" babel-plugin-syntax-decorators "^6.13.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" - babel-types "^6.13.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-do-expressions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.8.0.tgz#fda692af339835cc255bb7544efb8f7c1306c273" +babel-plugin-transform-do-expressions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb" dependencies: babel-plugin-syntax-do-expressions "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-arrow-functions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.8.0.tgz#5b63afc3181bdc9a8c4d481b5a4f3f7d7fef3d9d" +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoped-functions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.8.0.tgz#ed95d629c4b5a71ae29682b998f70d9833eb366d" +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoping@^6.18.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.21.0.tgz#e840687f922e70fb2c42bb13501838c174a115ed" +babel-plugin-transform-es2015-block-scoping@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz#e48895cf0b375be148cd7c8879b422707a053b51" dependencies: - babel-runtime "^6.20.0" - babel-template "^6.15.0" - babel-traverse "^6.21.0" - babel-types "^6.21.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" lodash "^4.2.0" -babel-plugin-transform-es2015-classes@^6.18.0, babel-plugin-transform-es2015-classes@^6.9.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.18.0.tgz#ffe7a17321bf83e494dcda0ae3fc72df48ffd1d9" - dependencies: - babel-helper-define-map "^6.18.0" - babel-helper-function-name "^6.18.0" - babel-helper-optimise-call-expression "^6.18.0" - babel-helper-replace-supers "^6.18.0" - babel-messages "^6.8.0" - babel-runtime "^6.9.0" - babel-template "^6.14.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" +babel-plugin-transform-es2015-classes@^6.22.0, babel-plugin-transform-es2015-classes@^6.9.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz#49b53f326202a2fd1b3bbaa5e2edd8a4f78643c1" + dependencies: + babel-helper-define-map "^6.23.0" + babel-helper-function-name "^6.23.0" + babel-helper-optimise-call-expression "^6.23.0" + babel-helper-replace-supers "^6.23.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-plugin-transform-es2015-computed-properties@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.8.0.tgz#f51010fd61b3bd7b6b60a5fdfd307bb7a5279870" +babel-plugin-transform-es2015-computed-properties@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz#7c383e9629bba4820c11b0425bdd6290f7f057e7" dependencies: - babel-helper-define-map "^6.8.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" -babel-plugin-transform-es2015-destructuring@^6.18.0, babel-plugin-transform-es2015-destructuring@^6.6.5: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.19.0.tgz#ff1d911c4b3f4cab621bd66702a869acd1900533" +babel-plugin-transform-es2015-destructuring@^6.19.0, babel-plugin-transform-es2015-destructuring@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" dependencies: - babel-runtime "^6.9.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-duplicate-keys@^6.6.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.8.0.tgz#fd8f7f7171fc108cc1c70c3164b9f15a81c25f7d" +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz#672397031c21610d72dd2bbb0ba9fb6277e1c36b" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.8.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-for-of@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.18.0.tgz#4c517504db64bf8cfc119a6b8f177211f2028a70" +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-function-name@^6.5.0, babel-plugin-transform-es2015-function-name@^6.9.0: - version "6.9.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.9.0.tgz#8c135b17dbd064e5bba56ec511baaee2fca82719" +babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.9.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz#f5fcc8b09093f9a23c76ac3d9e392c3ec4b77104" dependencies: - babel-helper-function-name "^6.8.0" - babel-runtime "^6.9.0" - babel-types "^6.9.0" + babel-helper-function-name "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-literals@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.8.0.tgz#50aa2e5c7958fc2ab25d74ec117e0cc98f046468" +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-modules-amd@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.18.0.tgz#49a054cbb762bdf9ae2d8a807076cfade6141e40" +babel-plugin-transform-es2015-modules-amd@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.22.0.tgz#bf69cd34889a41c33d90dfb740e0091ccff52f21" dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-plugin-transform-es2015-modules-commonjs "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" -babel-plugin-transform-es2015-modules-commonjs@^6.18.0, babel-plugin-transform-es2015-modules-commonjs@^6.7.4: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.18.0.tgz#c15ae5bb11b32a0abdcc98a5837baa4ee8d67bcc" +babel-plugin-transform-es2015-modules-commonjs@^6.18.0, babel-plugin-transform-es2015-modules-commonjs@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.23.0.tgz#cba7aa6379fb7ec99250e6d46de2973aaffa7b92" dependencies: - babel-plugin-transform-strict-mode "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.16.0" - babel-types "^6.18.0" + babel-plugin-transform-strict-mode "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-types "^6.23.0" -babel-plugin-transform-es2015-modules-systemjs@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.19.0.tgz#50438136eba74527efa00a5b0fefaf1dc4071da6" +babel-plugin-transform-es2015-modules-systemjs@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz#ae3469227ffac39b0310d90fec73bfdc4f6317b0" dependencies: - babel-helper-hoist-variables "^6.18.0" - babel-runtime "^6.11.6" - babel-template "^6.14.0" + babel-helper-hoist-variables "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" -babel-plugin-transform-es2015-modules-umd@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.18.0.tgz#23351770ece5c1f8e83ed67cb1d7992884491e50" +babel-plugin-transform-es2015-modules-umd@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.23.0.tgz#8d284ae2e19ed8fe21d2b1b26d6e7e0fcd94f0f1" dependencies: - babel-plugin-transform-es2015-modules-amd "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" -babel-plugin-transform-es2015-object-super@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.8.0.tgz#1b858740a5a4400887c23dcff6f4d56eea4a24c5" +babel-plugin-transform-es2015-object-super@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz#daa60e114a042ea769dd53fe528fc82311eb98fc" dependencies: - babel-helper-replace-supers "^6.8.0" - babel-runtime "^6.0.0" + babel-helper-replace-supers "^6.22.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-parameters@^6.18.0, babel-plugin-transform-es2015-parameters@^6.7.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.21.0.tgz#46a655e6864ef984091448cdf024d87b60b2a7d8" +babel-plugin-transform-es2015-parameters@^6.21.0, babel-plugin-transform-es2015-parameters@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz#3a2aabb70c8af945d5ce386f1a4250625a83ae3b" dependencies: - babel-helper-call-delegate "^6.18.0" - babel-helper-get-function-arity "^6.18.0" - babel-runtime "^6.9.0" - babel-template "^6.16.0" - babel-traverse "^6.21.0" - babel-types "^6.21.0" + babel-helper-call-delegate "^6.22.0" + babel-helper-get-function-arity "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-plugin-transform-es2015-shorthand-properties@^6.18.0, babel-plugin-transform-es2015-shorthand-properties@^6.5.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.18.0.tgz#e2ede3b7df47bf980151926534d1dd0cbea58f43" +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz#8ba776e0affaa60bff21e921403b8a652a2ff723" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-spread@^6.3.13, babel-plugin-transform-es2015-spread@^6.6.5: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.8.0.tgz#0217f737e3b821fa5a669f187c6ed59205f05e9c" +babel-plugin-transform-es2015-spread@^6.22.0, babel-plugin-transform-es2015-spread@^6.8.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-sticky-regex@^6.3.13, babel-plugin-transform-es2015-sticky-regex@^6.5.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.8.0.tgz#e73d300a440a35d5c64f5c2a344dc236e3df47be" +babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.8.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz#ab316829e866ee3f4b9eb96939757d19a5bc4593" dependencies: - babel-helper-regex "^6.8.0" - babel-runtime "^6.0.0" - babel-types "^6.8.0" + babel-helper-regex "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-template-literals@^6.6.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.8.0.tgz#86eb876d0a2c635da4ec048b4f7de9dfc897e66b" +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-typeof-symbol@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.18.0.tgz#0b14c48629c90ff47a0650077f6aa699bee35798" +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-unicode-regex@^6.3.13, babel-plugin-transform-es2015-unicode-regex@^6.5.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.11.0.tgz#6298ceabaad88d50a3f4f392d8de997260f6ef2c" +babel-plugin-transform-es2015-unicode-regex@^6.11.0, babel-plugin-transform-es2015-unicode-regex@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz#8d9cc27e7ee1decfe65454fb986452a04a613d20" dependencies: - babel-helper-regex "^6.8.0" - babel-runtime "^6.0.0" + babel-helper-regex "^6.22.0" + babel-runtime "^6.22.0" regexpu-core "^2.0.0" -babel-plugin-transform-exponentiation-operator@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.8.0.tgz#db25742e9339eade676ca9acec46f955599a68a4" +babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.8.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.22.0.tgz#d57c8335281918e54ef053118ce6eb108468084d" dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.8.0" + babel-helper-builder-binary-assignment-operator-visitor "^6.22.0" babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-export-extensions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.8.0.tgz#fa80ff655b636549431bfd38f6b817bd82e47f5b" +babel-plugin-transform-export-extensions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653" dependencies: babel-plugin-syntax-export-extensions "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" babel-plugin-transform-flow-strip-types@^6.14.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.21.0.tgz#2eea3f8b5bb234339b47283feac155cfb237b948" + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" dependencies: babel-plugin-syntax-flow "^6.18.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-function-bind@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.8.0.tgz#e7f334ce69f50d28fe850a822eaaab9fa4f4d821" +babel-plugin-transform-function-bind@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz#c6fb8e96ac296a310b8cf8ea401462407ddf6a97" dependencies: babel-plugin-syntax-function-bind "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-object-rest-spread@^6.16.0: - version "6.20.2" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.20.2.tgz#e816c55bba77b14c16365d87e2ae48c8fd18fc2e" +babel-plugin-transform-object-rest-spread@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" dependencies: babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.20.0" + babel-runtime "^6.22.0" -babel-plugin-transform-regenerator@^6.16.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.21.0.tgz#75d0c7e7f84f379358f508451c68a2c5fa5a9703" +babel-plugin-transform-regenerator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz#65740593a319c44522157538d690b84094617ea6" dependencies: regenerator-transform "0.9.8" -babel-plugin-transform-runtime@^6.15.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.15.0.tgz#3d75b4d949ad81af157570273846fb59aeb0d57c" +babel-plugin-transform-strict-mode@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.22.0.tgz#e008df01340fdc87e959da65991b7e05970c8c7c" dependencies: - babel-runtime "^6.9.0" - -babel-plugin-transform-strict-mode@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.18.0.tgz#df7cf2991fe046f44163dcd110d5ca43bc652b9d" - dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-polyfill@^6.16.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.20.0.tgz#de4a371006139e20990aac0be367d398331204e7" +babel-polyfill@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" dependencies: - babel-runtime "^6.20.0" + babel-runtime "^6.22.0" core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-preset-es2015-node4@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2015-node4/-/babel-preset-es2015-node4-2.1.1.tgz#e31f290859b58619c8cfa241d1b0bc900f941cdb" - dependencies: - babel-plugin-transform-es2015-destructuring "^6.6.5" - babel-plugin-transform-es2015-function-name "^6.5.0" - babel-plugin-transform-es2015-modules-commonjs "^6.7.4" - babel-plugin-transform-es2015-parameters "^6.7.0" - babel-plugin-transform-es2015-shorthand-properties "^6.5.0" - babel-plugin-transform-es2015-spread "^6.6.5" - babel-plugin-transform-es2015-sticky-regex "^6.5.0" - babel-plugin-transform-es2015-unicode-regex "^6.5.0" - -babel-preset-es2015@^6.14.0, babel-preset-es2015@^6.16.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.18.0.tgz#b8c70df84ec948c43dcf2bf770e988eb7da88312" - dependencies: - babel-plugin-check-es2015-constants "^6.3.13" - babel-plugin-transform-es2015-arrow-functions "^6.3.13" - babel-plugin-transform-es2015-block-scoped-functions "^6.3.13" - babel-plugin-transform-es2015-block-scoping "^6.18.0" - babel-plugin-transform-es2015-classes "^6.18.0" - babel-plugin-transform-es2015-computed-properties "^6.3.13" - babel-plugin-transform-es2015-destructuring "^6.18.0" - babel-plugin-transform-es2015-duplicate-keys "^6.6.0" - babel-plugin-transform-es2015-for-of "^6.18.0" - babel-plugin-transform-es2015-function-name "^6.9.0" - babel-plugin-transform-es2015-literals "^6.3.13" - babel-plugin-transform-es2015-modules-amd "^6.18.0" - babel-plugin-transform-es2015-modules-commonjs "^6.18.0" - babel-plugin-transform-es2015-modules-systemjs "^6.18.0" - babel-plugin-transform-es2015-modules-umd "^6.18.0" - babel-plugin-transform-es2015-object-super "^6.3.13" - babel-plugin-transform-es2015-parameters "^6.18.0" - babel-plugin-transform-es2015-shorthand-properties "^6.18.0" - babel-plugin-transform-es2015-spread "^6.3.13" - babel-plugin-transform-es2015-sticky-regex "^6.3.13" - babel-plugin-transform-es2015-template-literals "^6.6.0" - babel-plugin-transform-es2015-typeof-symbol "^6.18.0" - babel-plugin-transform-es2015-unicode-regex "^6.3.13" - babel-plugin-transform-regenerator "^6.16.0" +babel-preset-es2015@^6.14.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.22.0.tgz#af5a98ecb35eb8af764ad8a5a05eb36dc4386835" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.22.0" + babel-plugin-transform-es2015-classes "^6.22.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.22.0" + babel-plugin-transform-es2015-modules-systemjs "^6.22.0" + babel-plugin-transform-es2015-modules-umd "^6.22.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.22.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" babel-preset-stage-0@^6.5.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.16.0.tgz#f5a263c420532fd57491f1a7315b3036e428f823" + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.22.0.tgz#707eeb5b415da769eff9c42f4547f644f9296ef9" dependencies: - babel-plugin-transform-do-expressions "^6.3.13" - babel-plugin-transform-function-bind "^6.3.13" - babel-preset-stage-1 "^6.16.0" + babel-plugin-transform-do-expressions "^6.22.0" + babel-plugin-transform-function-bind "^6.22.0" + babel-preset-stage-1 "^6.22.0" -babel-preset-stage-1@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.16.0.tgz#9d31fbbdae7b17c549fd3ac93e3cf6902695e479" +babel-preset-stage-1@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.22.0.tgz#7da05bffea6ad5a10aef93e320cfc6dd465dbc1a" dependencies: - babel-plugin-transform-class-constructor-call "^6.3.13" - babel-plugin-transform-export-extensions "^6.3.13" - babel-preset-stage-2 "^6.16.0" + babel-plugin-transform-class-constructor-call "^6.22.0" + babel-plugin-transform-export-extensions "^6.22.0" + babel-preset-stage-2 "^6.22.0" -babel-preset-stage-2@^6.16.0, babel-preset-stage-2@^6.17.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.18.0.tgz#9eb7bf9a8e91c68260d5ba7500493caaada4b5b5" +babel-preset-stage-2@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.22.0.tgz#ccd565f19c245cade394b21216df704a73b27c07" dependencies: babel-plugin-syntax-dynamic-import "^6.18.0" - babel-plugin-transform-class-properties "^6.18.0" - babel-plugin-transform-decorators "^6.13.0" - babel-preset-stage-3 "^6.17.0" - -babel-preset-stage-3@^6.17.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.17.0.tgz#b6638e46db6e91e3f889013d8ce143917c685e39" - dependencies: - babel-plugin-syntax-trailing-function-commas "^6.3.13" - babel-plugin-transform-async-generator-functions "^6.17.0" - babel-plugin-transform-async-to-generator "^6.16.0" - babel-plugin-transform-exponentiation-operator "^6.3.13" - babel-plugin-transform-object-rest-spread "^6.16.0" - -babel-register@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.18.0.tgz#892e2e03865078dd90ad2c715111ec4449b32a68" - dependencies: - babel-core "^6.18.0" - babel-runtime "^6.11.6" + babel-plugin-transform-class-properties "^6.22.0" + babel-plugin-transform-decorators "^6.22.0" + babel-preset-stage-3 "^6.22.0" + +babel-preset-stage-3@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.22.0.tgz#a4e92bbace7456fafdf651d7a7657ee0bbca9c2e" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-generator-functions "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-object-rest-spread "^6.22.0" + +babel-register@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.23.0.tgz#c9aa3d4cca94b51da34826c4a0f9e08145d74ff3" + dependencies: + babel-core "^6.23.0" + babel-runtime "^6.22.0" core-js "^2.4.0" home-or-tmp "^2.0.0" lodash "^4.2.0" mkdirp "^0.5.1" source-map-support "^0.4.2" -babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.20.0, babel-runtime@^6.9.0, babel-runtime@^6.9.1: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.20.0.tgz#87300bdcf4cd770f09bf0048c64204e17806d16f" +babel-runtime@^6.18.0, babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-template@^6.7.0, babel-template@^6.8.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.16.0.tgz#e149dd1a9f03a35f817ddbc4d0481988e7ebc8ca" +babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.23.0, babel-template@^6.7.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638" dependencies: - babel-runtime "^6.9.0" - babel-traverse "^6.16.0" - babel-types "^6.16.0" + babel-runtime "^6.22.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" babylon "^6.11.0" lodash "^4.2.0" -babel-traverse@^6.15.0, babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.20.0, babel-traverse@^6.21.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.21.0.tgz#69c6365804f1a4f69eb1213f85b00a818b8c21ad" +babel-traverse@^6.15.0, babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1: + version "6.23.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" dependencies: - babel-code-frame "^6.20.0" - babel-messages "^6.8.0" - babel-runtime "^6.20.0" - babel-types "^6.21.0" - babylon "^6.11.0" + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" + babylon "^6.15.0" debug "^2.2.0" globals "^9.0.0" invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.13.0, babel-types@^6.15.0, babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.20.0, babel-types@^6.21.0, babel-types@^6.7.2, babel-types@^6.8.0, babel-types@^6.9.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.21.0.tgz#314b92168891ef6d3806b7f7a917fdf87c11a4b2" +babel-types@^6.15.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0, babel-types@^6.7.2: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" dependencies: - babel-runtime "^6.20.0" + babel-runtime "^6.22.0" esutils "^2.0.2" lodash "^4.2.0" to-fast-properties "^1.0.1" -babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0: +babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: version "6.15.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" @@ -1010,8 +1002,8 @@ balanced-match@^0.4.1: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" bcrypt-pbkdf@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz#3ca76b85241c7170bf7d9703e7b9aa74630040d4" + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" dependencies: tweetnacl "^0.14.3" @@ -1025,7 +1017,7 @@ block-stream@*: dependencies: inherits "~2.0.0" -bluebird@^3.0.0, bluebird@^3.4.1: +bluebird@^3.0.0: version "3.4.7" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" @@ -1165,7 +1157,7 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chokidar@^1.0.0, chokidar@^1.4.2: +chokidar@^1.4.2, chokidar@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" dependencies: @@ -1188,6 +1180,10 @@ circular-json@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" +clean-stack@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.1.1.tgz#a1b3711122df162df7c7cb9b3c0470f28cb58adb" + clean-yaml-object@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz#63fb110dc2ce1a84dc21f6d9334876d010ae8b68" @@ -1196,15 +1192,21 @@ cli-boxes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" -cli-cursor@^1.0.1, cli-cursor@^1.0.2: +cli-cursor@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" dependencies: restore-cursor "^1.0.1" -cli-spinners@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + dependencies: + restore-cursor "^2.0.0" + +cli-spinners@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.0.0.tgz#ef987ed3d48391ac3dab9180b406a742180d6e6a" cli-truncate@^0.2.0: version "0.2.1" @@ -1243,6 +1245,12 @@ co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" +code-excerpt@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/code-excerpt/-/code-excerpt-2.1.0.tgz#5dcc081e88f4a7e3b554e9e35d7ef232d47f8147" + dependencies: + convert-to-spaces "^1.0.1" + code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" @@ -1307,8 +1315,12 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" convert-source-map@^1.1.0, convert-source-map@^1.2.0, convert-source-map@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67" + version "1.4.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.4.0.tgz#e3dad195bf61bfe13a7a3c73e9876ec14a0268f3" + +convert-to-spaces@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/convert-to-spaces/-/convert-to-spaces-1.0.1.tgz#df97c15b6d061375cc4f3efe01bfc1f4d2a83ad6" core-assert@^0.2.0: version "0.2.1" @@ -1384,8 +1396,8 @@ debug-log@^1.0.1: resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" debug@^2.1.1, debug@^2.2.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" + version "2.6.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.1.tgz#79855090ba2c4e3115cc7d8769491d58f0491351" dependencies: ms "0.7.2" @@ -1443,6 +1455,10 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" +diff@^3.0.0, diff@^3.0.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + doctrine@^1.2.2: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -1456,16 +1472,18 @@ dot-prop@^3.0.0: dependencies: is-obj "^1.0.0" +dot-prop@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.1.1.tgz#a8493f0b7b5eeec82525b5c7587fa7de7ca859c1" + dependencies: + is-obj "^1.0.0" + duplexer2@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" dependencies: readable-stream "^2.0.2" -eastasianwidth@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.1.1.tgz#44d656de9da415694467335365fb3147b8572b7c" - ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" @@ -1479,6 +1497,10 @@ empower-core@^0.6.1: call-signature "0.0.2" core-js "^2.0.0" +equal-length@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/equal-length/-/equal-length-1.0.1.tgz#21ca112d48ab24b4e1e7ffc0e5339d31fdfc274c" + error-ex@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" @@ -1561,8 +1583,8 @@ eslint-plugin-flowtype@^2.20.0: lodash "^4.15.0" eslint@^3.7.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.13.1.tgz#564d2646b5efded85df96985332edd91a23bff25" + version "3.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.16.0.tgz#4a468ab93618a9eb6e3f1499038b38851f828630" dependencies: babel-code-frame "^6.16.0" chalk "^1.1.3" @@ -1570,7 +1592,7 @@ eslint@^3.7.1: debug "^2.1.1" doctrine "^1.2.2" escope "^3.6.0" - espree "^3.3.1" + espree "^3.4.0" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" @@ -1608,20 +1630,20 @@ espower-location-detector@^1.0.0: source-map "^0.5.0" xtend "^4.0.0" -espree@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.3.2.tgz#dbf3fadeb4ecb4d4778303e50103b3d36c88b89c" +espree@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d" dependencies: - acorn "^4.0.1" + acorn "4.0.4" acorn-jsx "^3.0.0" -esprima@^2.6.0: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" +esprima@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" espurify@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.6.0.tgz#6cb993582d9422bd6f2d4b258aadb14833f394f0" + version "1.6.1" + resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.6.1.tgz#a618c3b320071a4e9e7136c5d78717cdd07020da" dependencies: core-js "^2.0.0" @@ -1632,7 +1654,7 @@ esrecurse@^4.1.0: estraverse "~4.1.0" object-assign "^4.0.1" -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1661,6 +1683,18 @@ execSync@1.0.2: dependencies: temp "~0.5.1" +execa@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" + dependencies: + cross-spawn "^4.0.0" + get-stream "^2.2.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" @@ -1695,13 +1729,19 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -figures@^1.3.5, figures@^1.4.0: +figures@^1.3.5: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" dependencies: escape-string-regexp "^1.0.5" object-assign "^4.1.0" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + file-entry-cache@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" @@ -1742,6 +1782,12 @@ find-up@^1.0.0, find-up@^1.1.2: path-exists "^2.0.0" pinkie-promise "^2.0.0" +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + flat-cache@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" @@ -1797,8 +1843,8 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" fsevents@^1.0.0: - version "1.0.17" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.0.17.tgz#8537f3f12272678765b4fd6528c0f1f66f8f4558" + version "1.1.1" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.1.tgz#f19fd28f43eeaf761680e519a203c4d0b3d31aff" dependencies: nan "^2.3.0" node-pre-gyp "^0.6.29" @@ -1821,8 +1867,8 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: rimraf "2" gauge@~2.7.1: - version "2.7.2" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.2.tgz#15cecc31b02d05345a5d6b0e171cdb3ad2307774" + version "2.7.3" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09" dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -1831,7 +1877,6 @@ gauge@~2.7.1: signal-exit "^3.0.0" string-width "^1.0.1" strip-ansi "^3.0.1" - supports-color "^0.2.0" wide-align "^1.1.0" generate-function@^2.0.0: @@ -1858,6 +1903,13 @@ get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" +get-stream@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + getpass@^0.1.1: version "0.1.6" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" @@ -1877,16 +1929,6 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@^5.0.5: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" @@ -1899,8 +1941,8 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6: path-is-absolute "^1.0.0" globals@^9.0.0, globals@^9.14.0: - version "9.14.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" + version "9.16.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80" globby@^5.0.0: version "5.0.0" @@ -1943,7 +1985,7 @@ got@^5.0.0: unzip-response "^1.0.2" url-parse-lax "^1.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -1996,6 +2038,10 @@ has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" +has-yarn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-1.0.0.tgz#89e25db604b725c8f5976fff0addc921b828a5a7" + hawk@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" @@ -2017,8 +2063,8 @@ home-or-tmp@^2.0.0: os-tmpdir "^1.0.1" hosted-git-info@^2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" + version "2.2.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.2.0.tgz#7a0d097863d886c0fabbdcd37bf1758d8becf8a5" http-signature@~1.1.0: version "1.1.1" @@ -2028,13 +2074,13 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" -ignore-by-default@^1.0.0, ignore-by-default@^1.0.1: +ignore-by-default@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" ignore@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.0.tgz#8d88f03c3002a0ac52114db25d2c673b0bf1e435" + version "3.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.4.tgz#4055e03596729a8fabe45a43c100ad5ed815c4e8" imurmurhash@^0.1.4: version "0.1.4" @@ -2046,6 +2092,10 @@ indent-string@^2.1.0: dependencies: repeating "^2.0.0" +indent-string@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.1.0.tgz#08ff4334603388399b329e6b9538dc7a3cf5de7d" + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -2250,7 +2300,7 @@ is-retry-allowed@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" -is-stream@^1.0.0: +is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2262,7 +2312,7 @@ is-url@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.2.tgz#498905a593bf47cc2d9e7f738372bbf7696c7f26" -is-utf8@^0.2.0: +is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" @@ -2327,35 +2377,77 @@ istanbul-lib-source-maps@^1.1.0: source-map "^0.5.3" istanbul-reports@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.0.tgz#24b4eb2b1d29d50f103b369bd422f6e640aa0777" + version "1.0.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.1.tgz#9a17176bc4a6cbebdae52b2f15961d52fa623fbc" dependencies: handlebars "^4.0.3" +jest-diff@^18.1.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-18.1.0.tgz#4ff79e74dd988c139195b365dc65d87f606f4803" + dependencies: + chalk "^1.1.3" + diff "^3.0.0" + jest-matcher-utils "^18.1.0" + pretty-format "^18.1.0" + +jest-file-exists@^17.0.0: + version "17.0.0" + resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-17.0.0.tgz#7f63eb73a1c43a13f461be261768b45af2cdd169" + +jest-matcher-utils@^18.1.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-18.1.0.tgz#1ac4651955ee2a60cef1e7fcc98cdfd773c0f932" + dependencies: + chalk "^1.1.3" + pretty-format "^18.1.0" + +jest-mock@^18.0.0: + version "18.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-18.0.0.tgz#5c248846ea33fa558b526f5312ab4a6765e489b3" + +jest-snapshot@^18.1.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-18.1.0.tgz#55b96d2ee639c9bce76f87f2a3fd40b71c7a5916" + dependencies: + jest-diff "^18.1.0" + jest-file-exists "^17.0.0" + jest-matcher-utils "^18.1.0" + jest-util "^18.1.0" + natural-compare "^1.4.0" + pretty-format "^18.1.0" + +jest-util@^18.1.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-18.1.0.tgz#3a99c32114ab17f84be094382527006e6d4bfc6a" + dependencies: + chalk "^1.1.1" + diff "^3.0.0" + graceful-fs "^4.1.6" + jest-file-exists "^17.0.0" + jest-mock "^18.0.0" + mkdirp "^0.5.1" + jodid25519@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" dependencies: jsbn "~0.1.0" -js-tokens@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" - js-tokens@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.0.tgz#a2f2a969caae142fb3cd56228358c89366957bd1" + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" js-yaml@^3.5.1: - version "3.7.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" + version "3.8.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.1.tgz#782ba50200be7b9e5a8537001b7804db3ad02628" dependencies: argparse "^1.0.7" - esprima "^2.6.0" + esprima "^3.1.1" jsbn@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" jsesc@^1.3.0: version "1.3.0" @@ -2438,7 +2530,7 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -load-json-file@^1.0.0, load-json-file@^1.1.0: +load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" dependencies: @@ -2448,6 +2540,22 @@ load-json-file@^1.0.0, load-json-file@^1.1.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + lodash.debounce@^4.0.3: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -2460,7 +2568,7 @@ lodash.flatten@^4.2.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" -lodash.isequal@^4.4.0: +lodash.isequal@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" @@ -2520,6 +2628,12 @@ md5-hex@^1.2.0, md5-hex@^1.3.0: dependencies: md5-o-matic "^0.1.1" +md5-hex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-2.0.0.tgz#d0588e9f1c74954492ecd24ac0ac6ce997d92e33" + dependencies: + md5-o-matic "^0.1.1" + md5-o-matic@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" @@ -2573,7 +2687,11 @@ mime-types@^2.1.12, mime-types@~2.1.7: dependencies: mime-db "~1.26.0" -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2: +mimic-fn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + +minimatch@^3.0.0, minimatch@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: @@ -2615,16 +2733,16 @@ mute-stream@0.0.5: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" nan@^2.3.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.0.tgz#aa8f1e34531d807e9e27755b234b4a6ec0c152a8" + version "2.5.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2" natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" node-pre-gyp@^0.6.29: - version "0.6.32" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.32.tgz#fc452b376e7319b3d255f5f34853ef6fd8fe1fd5" + version "0.6.33" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz#640ac55198f6a925972e0c16c4ac26a034d5ecc9" dependencies: mkdirp "~0.5.1" nopt "~3.0.6" @@ -2659,6 +2777,12 @@ normalize-path@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + npmlog@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f" @@ -2742,6 +2866,12 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" +onetime@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.0.tgz#52aa8110e52fc5126ffc667bd8ec21c2ed209ce6" + dependencies: + mimic-fn "^1.0.0" + optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -2795,7 +2925,21 @@ output-file-sync@^1.1.0: mkdirp "^0.5.1" object-assign "^4.1.0" -package-hash@^1.1.0: +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +package-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/package-hash/-/package-hash-1.2.0.tgz#003e56cd57b736a6ed6114cc2b81542672770e44" dependencies: @@ -2839,6 +2983,10 @@ path-exists@^2.0.0: dependencies: pinkie-promise "^2.0.0" +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -2847,6 +2995,10 @@ path-is-inside@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" @@ -2859,6 +3011,12 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + dependencies: + pify "^2.0.0" + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -2883,14 +3041,12 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pkg-conf@^1.0.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-1.1.3.tgz#378e56d6fd13e88bfb6f4a25df7a83faabddba5b" +pkg-conf@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.0.0.tgz#071c87650403bccfb9c627f58751bfe47c067279" dependencies: - find-up "^1.0.0" - load-json-file "^1.1.0" - object-assign "^4.0.1" - symbol "^0.2.1" + find-up "^2.0.0" + load-json-file "^2.0.0" pkg-dir@^1.0.0: version "1.0.0" @@ -2912,53 +3068,6 @@ pluralize@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" -power-assert-context-formatter@^1.0.4: - version "1.1.1" - resolved "https://registry.yarnpkg.com/power-assert-context-formatter/-/power-assert-context-formatter-1.1.1.tgz#edba352d3ed8a603114d667265acce60d689ccdf" - dependencies: - core-js "^2.0.0" - power-assert-context-traversal "^1.1.1" - -power-assert-context-traversal@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/power-assert-context-traversal/-/power-assert-context-traversal-1.1.1.tgz#88cabca0d13b6359f07d3d3e8afa699264577ed9" - dependencies: - core-js "^2.0.0" - estraverse "^4.1.0" - -power-assert-renderer-assertion@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.1.1.tgz#cbfc0e77e0086a8f96af3f1d8e67b9ee7e28ce98" - dependencies: - power-assert-renderer-base "^1.1.1" - power-assert-util-string-width "^1.1.1" - -power-assert-renderer-base@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz#96a650c6fd05ee1bc1f66b54ad61442c8b3f63eb" - -power-assert-renderer-diagram@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.1.1.tgz#7e0c82cc08a84b155e51b5ae94f59709778a65fb" - dependencies: - core-js "^2.0.0" - power-assert-renderer-base "^1.1.1" - power-assert-util-string-width "^1.1.1" - stringifier "^1.3.0" - -power-assert-renderer-succinct@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/power-assert-renderer-succinct/-/power-assert-renderer-succinct-1.1.1.tgz#c2a468b23822abd6f80e2aba5322347b09df476e" - dependencies: - core-js "^2.0.0" - power-assert-renderer-diagram "^1.1.1" - -power-assert-util-string-width@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/power-assert-util-string-width/-/power-assert-util-string-width-1.1.1.tgz#be659eb7937fdd2e6c9a77268daaf64bd5b7c592" - dependencies: - eastasianwidth "^0.1.1" - prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -2971,6 +3080,12 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" +pretty-format@^18.1.0: + version "18.1.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-18.1.0.tgz#fb65a86f7a7f9194963eee91865c1bcf1039e284" + dependencies: + ansi-styles "^2.2.1" + pretty-ms@^0.2.1: version "0.2.2" resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-0.2.2.tgz#da879a682ff33a37011046f13d627f67c73b84f6" @@ -2986,8 +3101,8 @@ pretty-ms@^2.0.0: plur "^1.0.0" private@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1" + version "0.1.7" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" process-nextick-args@~1.0.6: version "1.0.7" @@ -3006,8 +3121,8 @@ punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" qs@~6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" + version "6.3.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.1.tgz#918c0b3bcd36679772baf135b1acb4c1651ed79d" randomatic@^1.1.3: version "1.1.6" @@ -3017,13 +3132,13 @@ randomatic@^1.1.3: kind-of "^3.0.2" rc@^1.0.1, rc@^1.1.6, rc@~1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" + version "1.1.7" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.7.tgz#c5ea564bb07aff9fd3a5b32e906c1d3a65940fea" dependencies: deep-extend "~0.4.0" ini "~1.3.0" minimist "^1.2.0" - strip-json-comments "~1.0.4" + strip-json-comments "~2.0.1" read-all-stream@^3.0.0: version "3.1.0" @@ -3039,6 +3154,13 @@ read-pkg-up@^1.0.1: find-up "^1.0.0" read-pkg "^1.0.0" +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -3047,6 +3169,14 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" @@ -3106,8 +3236,8 @@ regenerate@^1.2.1: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" regenerator-runtime@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb" + version "0.10.3" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" regenerator-transform@0.9.8: version "0.9.8" @@ -3241,15 +3371,22 @@ restore-cursor@^1.0.1: exit-hook "^1.0.0" onetime "^1.0.0" +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@^2.5.4, rimraf@~2.5.1, rimraf@~2.5.4: - version "2.5.4" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@^2.5.4: + version "2.6.0" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.0.tgz#89b8a0fe432b9ff9ec9a925a00b6cdb3a91bbada" dependencies: glob "^7.0.5" @@ -3259,6 +3396,12 @@ rimraf@~2.1.4: optionalDependencies: graceful-fs "~1" +rimraf@~2.5.1, rimraf@~2.5.4: + version "2.5.4" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" + dependencies: + glob "^7.0.5" + rollup-plugin-babel@^2.6.1: version "2.7.1" resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" @@ -3329,7 +3472,7 @@ signal-exit@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-2.1.2.tgz#375879b1f92ebc3b334480d038dc546a6d558564" -signal-exit@^3.0.0, signal-exit@^3.0.1: +signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -3358,8 +3501,8 @@ sort-keys@^1.1.1: is-plain-obj "^1.0.0" source-map-support@^0.4.0, source-map-support@^0.4.2: - version "0.4.10" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.10.tgz#d7b19038040a14c0837a18e630a196453952b378" + version "0.4.11" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.11.tgz#647f939978b38535909530885303daf23279f322" dependencies: source-map "^0.5.3" @@ -3417,9 +3560,9 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" -stack-utils@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-0.4.0.tgz#940cb82fccfa84e8ff2f3fdf293fe78016beccd1" +stack-utils@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.0.tgz#2392cd8ddbd222492ed6c047960f7414b46c0f83" string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" @@ -3440,14 +3583,6 @@ string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" -stringifier@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/stringifier/-/stringifier-1.3.0.tgz#def18342f6933db0f2dbfc9aa02175b448c17959" - dependencies: - core-js "^2.0.0" - traverse "^0.6.6" - type-name "^2.0.1" - stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -3462,6 +3597,12 @@ strip-ansi@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.1.1.tgz#39e8a98d044d150660abe4a6808acf70bb7bc991" +strip-bom-buf@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz#1cb45aaf57530f4caf86c7f75179d2c9a51dd572" + dependencies: + is-utf8 "^0.2.1" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -3472,24 +3613,20 @@ strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + strip-indent@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" dependencies: get-stdin "^4.0.1" -strip-json-comments@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" - strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -supports-color@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -3504,10 +3641,6 @@ symbol-observable@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" -symbol@^0.2.1: - version "0.2.3" - resolved "https://registry.yarnpkg.com/symbol/-/symbol-0.2.3.tgz#3b9873b8a901e47c6efe21526a3ac372ef28bbc7" - table@^3.7.8: version "3.8.3" resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" @@ -3556,14 +3689,20 @@ test-exclude@^3.3.0: read-pkg-up "^1.0.1" require-main-filename "^1.0.1" +test-exclude@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.0.tgz#0ddc0100b8ae7e88b34eb4fd98a907e961991900" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" -the-argv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/the-argv/-/the-argv-1.0.0.tgz#0084705005730dd84db755253c931ae398db9522" - through2@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" @@ -3598,14 +3737,14 @@ tough-cookie@~2.3.0: dependencies: punycode "^1.4.1" -traverse@^0.6.6: - version "0.6.6" - resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" - trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + try-resolve@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/try-resolve/-/try-resolve-1.0.1.tgz#cfde6fabd72d63e5797cfaab873abbe8e700e912" @@ -3628,10 +3767,6 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-name@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/type-name/-/type-name-2.0.2.tgz#efe7d4123d8ac52afff7f40c7e4dec5266008fb4" - typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -3794,23 +3929,21 @@ write-file-atomic@^1.1.2, write-file-atomic@^1.1.4: imurmurhash "^0.1.4" slide "^1.1.5" -write-json-file@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-1.2.0.tgz#2d5dfe96abc3c889057c93971aa4005efb548134" +write-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.0.0.tgz#0eaec981fcf9288dbc2806cbd26e06ab9bdca4ed" dependencies: graceful-fs "^4.1.2" mkdirp "^0.5.1" - object-assign "^4.0.1" pify "^2.0.0" - pinkie-promise "^2.0.0" sort-keys "^1.1.1" write-file-atomic "^1.1.2" -write-pkg@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-1.0.0.tgz#aeb8aa9d4d788e1d893dfb0854968b543a919f57" +write-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-2.0.0.tgz#93b922ee9a429f9bd74cdc69e549733c9e468156" dependencies: - write-json-file "^1.1.0" + write-json-file "^2.0.0" write@^0.2.1: version "0.2.1" From a4bf244f9afcaa5fd392e17b70cf531962d7f179 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 20 Feb 2017 23:12:19 +0100 Subject: [PATCH 019/105] 7.0.0-beta.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cb831d4765..d03f886ad9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.1", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From fe2d2a99ea80976873db3a3f39b4795a0913b2ee Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 20 Feb 2017 23:50:07 +0100 Subject: [PATCH 020/105] 7.0.0-beta.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d03f886ad9..7156ecb596 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "7.0.0-beta.1", + "version": "7.0.0-beta.2", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 8d90dc0d10e091ec1effc764c847a35f5614ff14 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 28 Feb 2017 12:31:58 -0500 Subject: [PATCH 021/105] [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384) * [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement * Fix rest element in array pattern at invalid location --- ast/spec.md | 41 +++++++++---------- src/parser/expression.js | 2 +- src/parser/lval.js | 10 ++--- src/parser/statement.js | 2 +- .../invalid-location}/actual.js | 0 .../invalid-location/options.json | 3 ++ .../object-rest-spread/expected.json | 4 +- .../es2015/uncategorised/288/options.json | 3 -- .../object-rest-spread/1/expected.json | 4 +- .../object-rest-spread/10/expected.json | 2 +- .../object-rest-spread/16/expected.json | 4 +- .../object-rest-spread/17/expected.json | 4 +- .../object-rest-spread/2/expected.json | 4 +- .../object-rest-spread/3/expected.json | 4 +- .../object-rest-spread/4/expected.json | 4 +- .../object-rest-spread/5/expected.json | 4 +- .../object-rest-spread/6/expected.json | 6 +-- 17 files changed, 48 insertions(+), 53 deletions(-) rename test/fixtures/es2015/{uncategorised/288 => array-rest-spread/invalid-location}/actual.js (100%) create mode 100644 test/fixtures/es2015/array-rest-spread/invalid-location/options.json delete mode 100644 test/fixtures/es2015/uncategorised/288/options.json diff --git a/ast/spec.md b/ast/spec.md index 2b57c89eac..9fb37f00fe 100644 --- a/ast/spec.md +++ b/ast/spec.md @@ -1,6 +1,7 @@ These are the core Babylon AST node types. - [Node objects](#node-objects) +- [Changes](#changes) - [Identifier](#identifier) - [Literals](#literals) - [RegExpLiteral](#regexpliteral) @@ -55,8 +56,6 @@ These are the core Babylon AST node types. - [ObjectMember](#objectmember) - [ObjectProperty](#objectproperty) - [ObjectMethod](#objectmethod) - - [RestProperty](#restproperty) - - [SpreadProperty](#spreadproperty) - [FunctionExpression](#functionexpression) - [Unary operations](#unary-operations) - [UnaryExpression](#unaryexpression) @@ -139,6 +138,22 @@ interface Position { } ``` +# Changes + +### Babylon 7 + +Flow: Node renamed from `ExistentialTypeParam` to `ExistsTypeAnnotation` [#322](https://github.com/babel/babylon/pull/322) + +Flow: Node renamed from `NumericLiteralTypeAnnotation` to `NumberLiteralTypeAnnotation` [babel/babylon#332](https://github.com/babel/babylon/pull/332) + +Flow: Node `Variance` which replaces the string value of the `variance` field on several nodes [babel/babylon#333](https://github.com/babel/babylon/pull/333) + +Flow: `ObjectTypeIndexer` location info matches Flow's better [babel/babylon#228](https://github.com/babel/babylon/pull/228) + +Node `ForAwaitStatement` has been removed [#349](https://github.com/babel/babylon/pull/349) in favor of modifying `ForOfStatement` + +`RestProperty` and `SpreadProperty` have been dropped in favor of `RestElement` and `SpreadElement`. + # Identifier ```js @@ -641,7 +656,7 @@ An array expression. ```js interface ObjectExpression <: Expression { type: "ObjectExpression"; - properties: [ ObjectProperty | ObjectMethod | SpreadProperty ]; + properties: [ ObjectProperty | ObjectMethod | SpreadElement ]; } ``` @@ -676,24 +691,6 @@ interface ObjectMethod <: ObjectMember, Function { } ``` -## RestProperty - -```js -interface RestProperty <: Node { - type: "RestProperty"; - argument: Expression; -} -``` - -## SpreadProperty - -```js -interface SpreadProperty <: Node { - type: "SpreadProperty"; - argument: Expression; -} -``` - ## FunctionExpression ```js @@ -960,7 +957,7 @@ interface AssignmentProperty <: ObjectProperty { interface ObjectPattern <: Pattern { type: "ObjectPattern"; - properties: [ AssignmentProperty | RestProperty ]; + properties: [ AssignmentProperty | RestPattern ]; } ``` diff --git a/src/parser/expression.js b/src/parser/expression.js index 11daa9e671..2f76616ba6 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -739,7 +739,7 @@ pp.parseObj = function (isPattern, refShorthandDefaultPos) { if (this.hasPlugin("objectRestSpread") && this.match(tt.ellipsis)) { prop = this.parseSpread(isPattern ? { start: 0 } : undefined); - prop.type = isPattern ? "RestProperty" : "SpreadProperty"; + prop.type = isPattern ? "RestElement" : "SpreadElement"; if (isPattern) this.toAssignable(prop.argument, true, "object pattern"); node.properties.push(prop); if (isPattern) { diff --git a/src/parser/lval.js b/src/parser/lval.js index da712e3298..60c26ec9f3 100644 --- a/src/parser/lval.js +++ b/src/parser/lval.js @@ -34,8 +34,8 @@ pp.toAssignable = function (node, isBinding, contextDescription) { this.toAssignable(node.value, isBinding, contextDescription); break; - case "SpreadProperty": - node.type = "RestProperty"; + case "SpreadElement": + node.type = "RestElement"; break; case "ArrayExpression": @@ -85,6 +85,8 @@ pp.toAssignableList = function (exprList, isBinding, contextDescription) { } for (let i = 0; i < end; i++) { const elt = exprList[i]; + if (elt && elt.type === "SpreadElement") + this.raise(elt.start, "The rest element has to be the last element when destructuring"); if (elt) this.toAssignable(elt, isBinding, contextDescription); } return exprList; @@ -246,10 +248,6 @@ pp.checkLVal = function (expr, isBinding, checkClashes, contextDescription) { this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern"); break; - case "RestProperty": - this.checkLVal(expr.argument, isBinding, checkClashes, "rest property"); - break; - case "RestElement": this.checkLVal(expr.argument, isBinding, checkClashes, "rest element"); break; diff --git a/src/parser/statement.js b/src/parser/statement.js index ab1347ff28..21846879bb 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -941,7 +941,7 @@ pp.checkDeclaration = function(node) { } } else if (node.type === "ObjectProperty") { this.checkDeclaration(node.value); - } else if (node.type === "RestElement" || node.type === "RestProperty") { + } else if (node.type === "RestElement") { this.checkDeclaration(node.argument); } else if (node.type === "Identifier") { this.checkDuplicateExports(node, node.name); diff --git a/test/fixtures/es2015/uncategorised/288/actual.js b/test/fixtures/es2015/array-rest-spread/invalid-location/actual.js similarity index 100% rename from test/fixtures/es2015/uncategorised/288/actual.js rename to test/fixtures/es2015/array-rest-spread/invalid-location/actual.js diff --git a/test/fixtures/es2015/array-rest-spread/invalid-location/options.json b/test/fixtures/es2015/array-rest-spread/invalid-location/options.json new file mode 100644 index 0000000000..beef14a214 --- /dev/null +++ b/test/fixtures/es2015/array-rest-spread/invalid-location/options.json @@ -0,0 +1,3 @@ +{ + "throws": "The rest element has to be the last element when destructuring (1:1)" +} diff --git a/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json b/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json index 00b780b1c4..e733023e1c 100644 --- a/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json +++ b/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json @@ -160,7 +160,7 @@ } }, { - "type": "RestProperty", + "type": "RestElement", "start": 21, "end": 29, "loc": { @@ -218,4 +218,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/es2015/uncategorised/288/options.json b/test/fixtures/es2015/uncategorised/288/options.json deleted file mode 100644 index d8b91465e5..0000000000 --- a/test/fixtures/es2015/uncategorised/288/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:1)" -} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/1/expected.json b/test/fixtures/experimental/object-rest-spread/1/expected.json index 5ee0540170..ee18f60048 100644 --- a/test/fixtures/experimental/object-rest-spread/1/expected.json +++ b/test/fixtures/experimental/object-rest-spread/1/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "RestProperty", + "type": "RestElement", "start": 5, "end": 9, "loc": { @@ -128,4 +128,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/experimental/object-rest-spread/10/expected.json b/test/fixtures/experimental/object-rest-spread/10/expected.json index bce210e65b..181a07c888 100644 --- a/test/fixtures/experimental/object-rest-spread/10/expected.json +++ b/test/fixtures/experimental/object-rest-spread/10/expected.json @@ -208,4 +208,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/experimental/object-rest-spread/16/expected.json b/test/fixtures/experimental/object-rest-spread/16/expected.json index 6f6be6d836..a722ab4fb5 100644 --- a/test/fixtures/experimental/object-rest-spread/16/expected.json +++ b/test/fixtures/experimental/object-rest-spread/16/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "RestProperty", + "type": "RestElement", "start": 5, "end": 11, "loc": { @@ -240,4 +240,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/experimental/object-rest-spread/17/expected.json b/test/fixtures/experimental/object-rest-spread/17/expected.json index 0c15cfbe9c..fa2ec13b14 100644 --- a/test/fixtures/experimental/object-rest-spread/17/expected.json +++ b/test/fixtures/experimental/object-rest-spread/17/expected.json @@ -73,7 +73,7 @@ }, "properties": [ { - "type": "RestProperty", + "type": "RestElement", "start": 6, "end": 18, "loc": { @@ -275,4 +275,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/experimental/object-rest-spread/2/expected.json b/test/fixtures/experimental/object-rest-spread/2/expected.json index f017a9cc8e..3e67ea3d00 100644 --- a/test/fixtures/experimental/object-rest-spread/2/expected.json +++ b/test/fixtures/experimental/object-rest-spread/2/expected.json @@ -123,7 +123,7 @@ } }, { - "type": "RestProperty", + "type": "RestElement", "start": 8, "end": 12, "loc": { @@ -178,4 +178,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/experimental/object-rest-spread/3/expected.json b/test/fixtures/experimental/object-rest-spread/3/expected.json index 64c2046836..170cb077f2 100644 --- a/test/fixtures/experimental/object-rest-spread/3/expected.json +++ b/test/fixtures/experimental/object-rest-spread/3/expected.json @@ -126,7 +126,7 @@ } }, { - "type": "RestProperty", + "type": "RestElement", "start": 14, "end": 18, "loc": { @@ -184,4 +184,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/experimental/object-rest-spread/4/expected.json b/test/fixtures/experimental/object-rest-spread/4/expected.json index 0a777c2a2f..1d025448b2 100644 --- a/test/fixtures/experimental/object-rest-spread/4/expected.json +++ b/test/fixtures/experimental/object-rest-spread/4/expected.json @@ -89,7 +89,7 @@ }, "properties": [ { - "type": "SpreadProperty", + "type": "SpreadElement", "start": 9, "end": 13, "loc": { @@ -127,4 +127,4 @@ } ] } -} \ No newline at end of file +} diff --git a/test/fixtures/experimental/object-rest-spread/5/expected.json b/test/fixtures/experimental/object-rest-spread/5/expected.json index 13c6c8dc0c..4089ed42a6 100644 --- a/test/fixtures/experimental/object-rest-spread/5/expected.json +++ b/test/fixtures/experimental/object-rest-spread/5/expected.json @@ -139,7 +139,7 @@ } }, { - "type": "SpreadProperty", + "type": "SpreadElement", "start": 8, "end": 12, "loc": { @@ -176,4 +176,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/experimental/object-rest-spread/6/expected.json b/test/fixtures/experimental/object-rest-spread/6/expected.json index 748d406185..4950385f5f 100644 --- a/test/fixtures/experimental/object-rest-spread/6/expected.json +++ b/test/fixtures/experimental/object-rest-spread/6/expected.json @@ -113,7 +113,7 @@ } }, { - "type": "SpreadProperty", + "type": "SpreadElement", "start": 5, "end": 9, "loc": { @@ -200,7 +200,7 @@ } }, { - "type": "SpreadProperty", + "type": "SpreadElement", "start": 14, "end": 18, "loc": { @@ -296,4 +296,4 @@ ], "directives": [] } -} \ No newline at end of file +} From 575e0d58ddc8bef9a7fe974a0ee037f41f3d2052 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 28 Feb 2017 14:46:25 -0500 Subject: [PATCH 022/105] update lock --- yarn.lock | 93 +++++++++++++++++++++++++++---------------------------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/yarn.lock b/yarn.lock index ff0d82e2c1..a723d4659b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,7 +1,5 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 - - "@ava/babel-preset-stage-4@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@ava/babel-preset-stage-4/-/babel-preset-stage-4-1.0.0.tgz#a613b5e152f529305422546b072d47facfb26291" @@ -44,14 +42,14 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" - acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" +acorn@4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" + ajv-keywords@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" @@ -332,7 +330,7 @@ babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@6, babel-core@^6.17.0, babel-core@^6.23.0: +babel-core@^6.17.0, babel-core@^6.23.0, babel-core@6: version "6.23.1" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.23.1.tgz#c143cb621bb2f621710c220c5d579d15b8a442df" dependencies: @@ -1543,7 +1541,7 @@ es6-set@~0.1.3: es6-symbol "3" event-emitter "~0.3.4" -es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: +es6-symbol@~3.1, es6-symbol@~3.1.0, es6-symbol@3: version "3.1.0" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" dependencies: @@ -1677,12 +1675,6 @@ event-emitter@~0.3.4: d "~0.1.1" es5-ext "~0.10.7" -execSync@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/execSync/-/execSync-1.0.2.tgz#1f42eda582225180053224ecdd3fd1960fdb3139" - dependencies: - temp "~0.5.1" - execa@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" @@ -1695,6 +1687,12 @@ execa@^0.5.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execSync@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/execSync/-/execSync-1.0.2.tgz#1f42eda582225180053224ecdd3fd1960fdb3139" + dependencies: + temp "~0.5.1" + exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" @@ -1797,9 +1795,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.38.0: - version "0.38.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.38.0.tgz#3ae096d401c969cc8b5798253fb82381e2d0237a" +flow-bin@^0.40.0: + version "0.40.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.40.0.tgz#e10d60846d923124e47f548f16ba60fd8baff5a5" fn-name@^2.0.0: version "2.0.1" @@ -2103,7 +2101,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1: +inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@2: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -2316,7 +2314,7 @@ is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: +isarray@^1.0.0, isarray@~1.0.0, isarray@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2697,28 +2695,28 @@ minimatch@^3.0.0, minimatch@^3.0.2: dependencies: brace-expansion "^1.0.0" -minimist@0.0.8, minimist@~0.0.1: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: +minimist@~0.0.1, minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +mkdirp@^0.5.0, mkdirp@^0.5.1, "mkdirp@>=0.5 0", mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" +ms@^0.7.1, ms@0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" + ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" -ms@0.7.2, ms@^0.7.1: - version "0.7.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" - multimatch@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" @@ -3298,7 +3296,7 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@>=2.42.0, request@^2.79.0: +request@^2.79.0, request@>=2.42.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" dependencies: @@ -3356,14 +3354,14 @@ resolve-from@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - resolve@^1.1.6: version "1.2.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + restore-cursor@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" @@ -3384,7 +3382,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@^2.5.4: +rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@^2.5.4, rimraf@2: version "2.6.0" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.0.tgz#89b8a0fe432b9ff9ec9a925a00b6cdb3a91bbada" dependencies: @@ -3448,7 +3446,7 @@ semver-diff@^2.0.0: dependencies: semver "^5.0.3" -"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@~5.3.0: +semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@~5.3.0, "semver@2 || 3 || 4 || 5": version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -3564,6 +3562,10 @@ stack-utils@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.0.tgz#2392cd8ddbd222492ed6c047960f7414b46c0f83" +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -3579,10 +3581,6 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -3703,6 +3701,10 @@ text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + through2@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" @@ -3710,10 +3712,6 @@ through2@^2.0.0: readable-stream "^2.1.5" xtend "~4.0.1" -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - time-require@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/time-require/-/time-require-0.1.2.tgz#f9e12cb370fc2605e11404582ba54ef5ca2b2d98" @@ -3898,10 +3896,6 @@ window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" @@ -3910,6 +3904,10 @@ wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -4001,3 +3999,4 @@ yargs@~3.10.0: cliui "^2.1.0" decamelize "^1.0.0" window-size "0.1.0" + From e2cd62449edc9755e44ac14983aca76dbb001be7 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 28 Feb 2017 14:47:08 -0500 Subject: [PATCH 023/105] 7.0.0-beta.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f71f87ab02..bbe27525f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "7.0.0-beta.2", + "version": "7.0.0-beta.3", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 56a92ccec1f1b81b39c8a9e326079666dd6d363b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 28 Feb 2017 14:56:40 -0500 Subject: [PATCH 024/105] changelog [skip ci] --- CHANGELOG.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb482fc5c7..67c3ebe8ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,48 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) for the pre-6.8.0 version Changelog. +## 7.0.0-beta.3 (2017-02-28) + +- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384) +- Merge changes from 6.x + +## 7.0.0-beta.2 (2017-02-20) + +- estree: correctly change literals in all cases (#368) (Daniel Tschinder) + +## 7.0.0-beta.1 (2017-02-20) + +- Fix negative number literal typeannotations (#366) (Daniel Tschinder) +- Update contributing with more test info [skip ci] (#355) (Brian Ng) + +## 7.0.0-beta.0 (2017-02-15) + +- Reintroduce Variance node (#333) (Daniel Tschinder) +- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick) +- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail) +- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot]) +- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot]) +- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder) +- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi) +- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder) +- Remove classConstructorCall plugin (#291) (Brian Ng) +- Update yarn.lock (Daniel Tschinder) +- Update cross-env to 3.x (Daniel Tschinder) +- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov) +- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens) + +## 6.16.1 (2017-02-23) + +### :bug: Regression + +- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375)) + +Need to modify Babel for this AST node change, so moving to 7.0. + +- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376)) + +[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted. + ## 6.16.0 (2017-02-23) ### :rocket: New Feature From aec4beff0c2dae9ae99db8f5169d8460aa6db1dd Mon Sep 17 00:00:00 2001 From: Andrew Levine Date: Mon, 23 Jan 2017 16:56:39 -0600 Subject: [PATCH 025/105] Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) --- src/parser/statement.js | 7 ++++++- .../with-initializer-and-type-no-plugin/actual.js | 3 +++ .../with-initializer-and-type-no-plugin/options.json | 4 ++++ .../with-initializer-missing-plugin/actual.js | 3 +++ .../with-initializer-missing-plugin/options.json | 3 +++ .../without-initializer-missing-plugin/actual.js | 3 +++ .../without-initializer-missing-plugin/options.json | 3 +++ 7 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/actual.js create mode 100644 test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/options.json create mode 100644 test/fixtures/experimental/class-properties/with-initializer-missing-plugin/actual.js create mode 100644 test/fixtures/experimental/class-properties/with-initializer-missing-plugin/options.json create mode 100644 test/fixtures/experimental/class-properties/without-initializer-missing-plugin/actual.js create mode 100644 test/fixtures/experimental/class-properties/without-initializer-missing-plugin/options.json diff --git a/src/parser/statement.js b/src/parser/statement.js index 236c5dc019..f4e82f5993 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -751,8 +751,13 @@ pp.parseClassBody = function (node) { }; pp.parseClassProperty = function (node) { + const noPluginMsg = "You can only use Class Properties when the 'classProperties' plugin is enabled."; + if (!node.typeAnnotation && !this.hasPlugin("classProperties")) { + this.raise(node.start, noPluginMsg); + } + if (this.match(tt.eq)) { - if (!this.hasPlugin("classProperties")) this.unexpected(); + if (!this.hasPlugin("classProperties")) this.raise(this.state.start, noPluginMsg); this.next(); node.value = this.parseMaybeAssign(); } else { diff --git a/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/actual.js b/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/actual.js new file mode 100644 index 0000000000..f82f8d51d7 --- /dev/null +++ b/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/actual.js @@ -0,0 +1,3 @@ +class Foo { + bar: string = 'bizz'; +} diff --git a/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/options.json b/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/options.json new file mode 100644 index 0000000000..e185feb80a --- /dev/null +++ b/test/fixtures/experimental/class-properties/with-initializer-and-type-no-plugin/options.json @@ -0,0 +1,4 @@ +{ + "plugins": ["flow"], + "throws": "You can only use Class Properties when the 'classProperties' plugin is enabled. (2:14)" +} diff --git a/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/actual.js b/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/actual.js new file mode 100644 index 0000000000..fa80e3af68 --- /dev/null +++ b/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/actual.js @@ -0,0 +1,3 @@ +class Foo { + bar = 'bizz'; +} diff --git a/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/options.json b/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/options.json new file mode 100644 index 0000000000..af38bd1530 --- /dev/null +++ b/test/fixtures/experimental/class-properties/with-initializer-missing-plugin/options.json @@ -0,0 +1,3 @@ +{ + "throws": "You can only use Class Properties when the 'classProperties' plugin is enabled. (2:2)" +} diff --git a/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/actual.js b/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/actual.js new file mode 100644 index 0000000000..a36cdd975c --- /dev/null +++ b/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/actual.js @@ -0,0 +1,3 @@ +class Foo { + bar; +} diff --git a/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/options.json b/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/options.json new file mode 100644 index 0000000000..af38bd1530 --- /dev/null +++ b/test/fixtures/experimental/class-properties/without-initializer-missing-plugin/options.json @@ -0,0 +1,3 @@ +{ + "throws": "You can only use Class Properties when the 'classProperties' plugin is enabled. (2:2)" +} From f1e2cca76701606124971f1f6e545824e731e356 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 1 Mar 2017 10:57:06 -0500 Subject: [PATCH 026/105] Add back ranges property (#363) * Add back ranges property * Correctly adjust range in flow plugin * Make it an option --- src/options.js | 12 +- src/parser/node.js | 24 +- src/plugins/flow.js | 3 +- src/util/location.js | 4 +- .../fixtures/core/opts/ranges-false/actual.js | 3 + .../core/opts/ranges-false/expected.json | 207 ++++++++++++++ test/fixtures/core/opts/ranges-true/actual.js | 3 + .../core/opts/ranges-true/expected.json | 255 ++++++++++++++++++ .../core/opts/ranges-true/options.json | 3 + test/utils/runFixtureTests.js | 2 - 10 files changed, 504 insertions(+), 12 deletions(-) create mode 100644 test/fixtures/core/opts/ranges-false/actual.js create mode 100644 test/fixtures/core/opts/ranges-false/expected.json create mode 100644 test/fixtures/core/opts/ranges-true/actual.js create mode 100644 test/fixtures/core/opts/ranges-true/expected.json create mode 100644 test/fixtures/core/opts/ranges-true/options.json diff --git a/src/options.js b/src/options.js index 72c65f34a6..ad75996fce 100755 --- a/src/options.js +++ b/src/options.js @@ -9,7 +9,8 @@ export const defaultOptions: { allowImportExportEverywhere: boolean, allowSuperOutsideMethod: boolean, plugins: Array, - strictMode: any + strictMode: any, + ranges: boolean, } = { // Source type ("script" or "module") for different semantics sourceType: "script", @@ -30,6 +31,15 @@ export const defaultOptions: { plugins: [], // TODO strictMode: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, }; // Interpret and default an options object diff --git a/src/parser/node.js b/src/parser/node.js index 86f697c130..364323ec7f 100644 --- a/src/parser/node.js +++ b/src/parser/node.js @@ -1,5 +1,5 @@ import Parser from "./index"; -import { SourceLocation } from "../util/location"; +import { SourceLocation, type Position } from "../util/location"; // Start an AST node, attaching a start offset. @@ -7,12 +7,13 @@ const pp = Parser.prototype; const commentKeys = ["leadingComments", "trailingComments", "innerComments"]; class Node { - constructor(pos?: number, loc?: number, filename?: string) { + constructor(parser?: Parser, pos?: number, loc?: Position) { this.type = ""; this.start = pos; this.end = 0; this.loc = new SourceLocation(loc); - if (filename) this.loc.filename = filename; + if (parser && parser.options.ranges) this.range = [pos, 0]; + if (parser && parser.filename) this.loc.filename = parser.filename; } type: string; @@ -34,17 +35,18 @@ class Node { } pp.startNode = function () { - return new Node(this.state.start, this.state.startLoc, this.filename); + return new Node(this, this.state.start, this.state.startLoc); }; pp.startNodeAt = function (pos, loc) { - return new Node(pos, loc, this.filename); + return new Node(this, pos, loc); }; function finishNodeAt(node, type, pos, loc) { node.type = type; node.end = pos; node.loc.end = loc; + if (this.options.ranges) node.range[1] = pos; this.processComment(node); return node; } @@ -60,3 +62,15 @@ pp.finishNode = function (node, type) { pp.finishNodeAt = function (node, type, pos, loc) { return finishNodeAt.call(this, node, type, pos, loc); }; + + +/** + * Reset the start location of node to the start location of locationNode + */ +pp.resetStartLocationFromNode = function (node, locationNode) { + node.start = locationNode.start; + node.loc.start = locationNode.loc.start; + if (this.options.ranges) node.range[0] = locationNode.range[0]; + + return node; +}; diff --git a/src/plugins/flow.js b/src/plugins/flow.js index cd58319631..25483df19f 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -1381,8 +1381,7 @@ export default function (instance) { arrowExpression = inner.apply(this, args); arrowExpression.typeParameters = typeParameters; - arrowExpression.start = typeParameters.start; - arrowExpression.loc.start = typeParameters.loc.start; + this.resetStartLocationFromNode(arrowExpression, typeParameters); } catch (err) { throw jsxError || err; } diff --git a/src/util/location.js b/src/util/location.js index 38137496c1..fb53aab1c5 100644 --- a/src/util/location.js +++ b/src/util/location.js @@ -4,14 +4,14 @@ import { lineBreakG } from "./whitespace"; // `startLoc` and `endLoc` properties. export class Position { - constructor(line, col) { + constructor(line: number, col: number) { this.line = line; this.column = col; } } export class SourceLocation { - constructor(start, end) { + constructor(start: Position, end?: Position) { this.start = start; this.end = end; } diff --git a/test/fixtures/core/opts/ranges-false/actual.js b/test/fixtures/core/opts/ranges-false/actual.js new file mode 100644 index 0000000000..a5433428e9 --- /dev/null +++ b/test/fixtures/core/opts/ranges-false/actual.js @@ -0,0 +1,3 @@ +var a = 1; + +var b = a + 1; diff --git a/test/fixtures/core/opts/ranges-false/expected.json b/test/fixtures/core/opts/ranges-false/expected.json new file mode 100644 index 0000000000..e8ab354792 --- /dev/null +++ b/test/fixtures/core/opts/ranges-false/expected.json @@ -0,0 +1,207 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "init": { + "type": "BinaryExpression", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/opts/ranges-true/actual.js b/test/fixtures/core/opts/ranges-true/actual.js new file mode 100644 index 0000000000..a5433428e9 --- /dev/null +++ b/test/fixtures/core/opts/ranges-true/actual.js @@ -0,0 +1,3 @@ +var a = 1; + +var b = a + 1; diff --git a/test/fixtures/core/opts/ranges-true/expected.json b/test/fixtures/core/opts/ranges-true/expected.json new file mode 100644 index 0000000000..c5e28e30ea --- /dev/null +++ b/test/fixtures/core/opts/ranges-true/expected.json @@ -0,0 +1,255 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 0, + 26 + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 0, + 26 + ], + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "range": [ + 0, + 10 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 4, + 9 + ], + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "range": [ + 4, + 5 + ], + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ], + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "range": [ + 12, + 26 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 16, + 25 + ], + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "b" + }, + "range": [ + 16, + 17 + ], + "name": "b" + }, + "init": { + "type": "BinaryExpression", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 20, + 25 + ], + "left": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "a" + }, + "range": [ + 20, + 21 + ], + "name": "a" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 24, + 25 + ], + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/opts/ranges-true/options.json b/test/fixtures/core/opts/ranges-true/options.json new file mode 100644 index 0000000000..7d108ad39d --- /dev/null +++ b/test/fixtures/core/opts/ranges-true/options.json @@ -0,0 +1,3 @@ +{ + "ranges": true +} diff --git a/test/utils/runFixtureTests.js b/test/utils/runFixtureTests.js index c391632f84..99b9787939 100644 --- a/test/utils/runFixtureTests.js +++ b/test/utils/runFixtureTests.js @@ -61,8 +61,6 @@ function save(test, ast) { function runTest(test, parseFunction) { var opts = test.options; - opts.locations = true; - opts.ranges = true; if (opts.throws && test.expect.code) { throw new Error("File expected.json exists although options specify throws. Remove expected.json."); From fdb0b50c866e4fd9801c20409bc295ec41917dcd Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 1 Mar 2017 11:00:36 -0500 Subject: [PATCH 027/105] add ranges [skip ci] --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6836b8f84e..892fbc4995 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ mind. When in doubt, use `.parse()`. - **strictMode**: TODO +- **ranges**: Adds a `ranges` property to each node: `[node.start, node.end]` + ### Output Babylon generates AST according to [Babel AST format][]. From c8c71684c4e2232b27146c330110a704b10214b3 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 1 Mar 2017 11:11:48 -0600 Subject: [PATCH 028/105] Don't consume async when checking for async func decl (#377) --- src/parser/statement.js | 7 + .../async-functions/export-arrow/actual.js | 1 + .../export-arrow/expected.json | 117 ++++++++++++ .../async-functions/export-arrow/options.json | 3 + .../es2017/async-functions/export/actual.js | 2 + .../async-functions/export/expected.json | 172 ++++++++++++++++++ .../async-functions/export/options.json | 3 + 7 files changed, 305 insertions(+) create mode 100644 test/fixtures/es2017/async-functions/export-arrow/actual.js create mode 100644 test/fixtures/es2017/async-functions/export-arrow/expected.json create mode 100644 test/fixtures/es2017/async-functions/export-arrow/options.json create mode 100644 test/fixtures/es2017/async-functions/export/actual.js create mode 100644 test/fixtures/es2017/async-functions/export/expected.json create mode 100644 test/fixtures/es2017/async-functions/export/options.json diff --git a/src/parser/statement.js b/src/parser/statement.js index f4e82f5993..d5d9c76f7c 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -825,6 +825,13 @@ pp.parseExport = function (node) { let needsSemi = false; if (this.eat(tt._function)) { expr = this.parseFunction(expr, true, false, false, true); + } else if ( + this.isContextual("async") && + this.lookahead().type === tt._function + ) { // async function declaration + this.eatContextual("async"); + this.eat(tt._function); + expr = this.parseFunction(expr, true, false, true, true); } else if (this.match(tt._class)) { expr = this.parseClass(expr, true, true); } else { diff --git a/test/fixtures/es2017/async-functions/export-arrow/actual.js b/test/fixtures/es2017/async-functions/export-arrow/actual.js new file mode 100644 index 0000000000..b5d8066db5 --- /dev/null +++ b/test/fixtures/es2017/async-functions/export-arrow/actual.js @@ -0,0 +1 @@ +export default async () => await foo() diff --git a/test/fixtures/es2017/async-functions/export-arrow/expected.json b/test/fixtures/es2017/async-functions/export-arrow/expected.json new file mode 100644 index 0000000000..dd7fe7275a --- /dev/null +++ b/test/fixtures/es2017/async-functions/export-arrow/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "declaration": { + "type": "ArrowFunctionExpression", + "start": 15, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": true, + "params": [], + "body": { + "type": "AwaitExpression", + "start": 27, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "argument": { + "type": "CallExpression", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "callee": { + "type": "Identifier", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/export-arrow/options.json b/test/fixtures/es2017/async-functions/export-arrow/options.json new file mode 100644 index 0000000000..2104ca4328 --- /dev/null +++ b/test/fixtures/es2017/async-functions/export-arrow/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/test/fixtures/es2017/async-functions/export/actual.js b/test/fixtures/es2017/async-functions/export/actual.js new file mode 100644 index 0000000000..3f043e6176 --- /dev/null +++ b/test/fixtures/es2017/async-functions/export/actual.js @@ -0,0 +1,2 @@ +export async function foo() {} +export default async function bar() {} diff --git a/test/fixtures/es2017/async-functions/export/expected.json b/test/fixtures/es2017/async-functions/export/expected.json new file mode 100644 index 0000000000..68a60db703 --- /dev/null +++ b/test/fixtures/es2017/async-functions/export/expected.json @@ -0,0 +1,172 @@ +{ + "type": "File", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "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": [] + } + } + }, + { + "type": "ExportDefaultDeclaration", + "start": 31, + "end": 69, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "declaration": { + "type": "FunctionDeclaration", + "start": 46, + "end": 69, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 61, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 33 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "generator": false, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 67, + "end": 69, + "loc": { + "start": { + "line": 2, + "column": 36 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/export/options.json b/test/fixtures/es2017/async-functions/export/options.json new file mode 100644 index 0000000000..2104ca4328 --- /dev/null +++ b/test/fixtures/es2017/async-functions/export/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} From 38cf1910c181d86ce7aaf187c37ec21fb87a9e63 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 1 Mar 2017 12:15:32 -0500 Subject: [PATCH 029/105] 7.0.0-beta.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bbe27525f5..f4d27e98fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "7.0.0-beta.3", + "version": "7.0.0-beta.4", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 2766263eeabb3f3f4bc2b280c29c7c9d69bf914d Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 1 Mar 2017 12:32:08 -0500 Subject: [PATCH 030/105] 7.0-beta.3 changelog [skip ci] --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67c3ebe8ac..06505dbe69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) for the pre-6.8.0 version Changelog. +## 7.0.0-beta.3 (2017-03-01) + +* Don't consume async when checking for async func decl (#377) (Brian Ng) +* add `ranges` option [skip ci] (Henry Zhu) +* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine) + ## 7.0.0-beta.3 (2017-02-28) - [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384) From 265d2c1e4ffb40895d2998bf886281a443fd4311 Mon Sep 17 00:00:00 2001 From: Aaron Ang Date: Wed, 1 Mar 2017 19:48:14 -0800 Subject: [PATCH 031/105] Explain how to run only one test (#389) [skip ci] --- CONTRIBUTING.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5130b2c078..131cf346f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,6 +31,26 @@ npm run test-only Note, this does not actually run a build, so you may have to call `npm run build` after performing any changes. +### Running one test + +To run only a single test, add `"only": true` to the `options.json` inside any test fixture folder (you may have to create the file if it doesn't exist). +For example, let's say we want to only run the test for the [`test/fixtures/comments/basic/shebang-import`](https://github.com/babel/babylon/tree/7.0/test/fixtures/comments/basic/shebang-import) fixture. + +Add `"only": true` to its `options.json`: + +```json +{ + "sourceType": "module", + "only": true +} +``` + +Then, run the tests using the same command as before: + +```bash +$ npm run test-only +``` + ### Checking code coverage locally To generate code coverage, be sure to set `BABEL_ENV=test` so that code is instrumented during From 05dd6d45451a3dbe077e776610bef3db781d973e Mon Sep 17 00:00:00 2001 From: Sumedh Nimkarde Date: Thu, 2 Mar 2017 21:40:02 +0530 Subject: [PATCH 032/105] Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] --- CONTRIBUTING.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 131cf346f3..c065958bdf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,10 +6,14 @@ contributing, please read the ## Setup local env +> Install yarn beforehand: https://yarnpkg.com/en/docs/install + To start developing on Babylon you only need to install its dependencies: ```bash -npm install +git clone https://github.com/babel/babylon +cd babylon +yarn ``` ## Tests @@ -48,7 +52,7 @@ Add `"only": true` to its `options.json`: Then, run the tests using the same command as before: ```bash -$ npm run test-only +npm run test-only ``` ### Checking code coverage locally From 1165d7e8c79e3b9d0283fbcb0541231ab451a759 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 2 Mar 2017 11:48:55 -0500 Subject: [PATCH 033/105] typo [skip ci] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06505dbe69..161458e9c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) for the pre-6.8.0 version Changelog. -## 7.0.0-beta.3 (2017-03-01) +## 7.0.0-beta.4 (2017-03-01) * Don't consume async when checking for async func decl (#377) (Brian Ng) * add `ranges` option [skip ci] (Henry Zhu) From 962ce16e8496788cda546214a62600f17b9a6623 Mon Sep 17 00:00:00 2001 From: Alex Kuzmenko Date: Fri, 3 Mar 2017 22:38:04 +0200 Subject: [PATCH 034/105] Add DoExpression to spec (#364) --- ast/spec.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ast/spec.md b/ast/spec.md index 9e2e094b9f..e3c5ec07b0 100644 --- a/ast/spec.md +++ b/ast/spec.md @@ -78,6 +78,7 @@ These are the core Babylon AST node types. - [CallExpression](#callexpression) - [NewExpression](#newexpression) - [SequenceExpression](#sequenceexpression) + - [DoExpression](#doexpression) - [Template Literals](#template-literals) - [TemplateLiteral](#templateliteral) - [TaggedTemplateExpression](#taggedtemplateexpression) @@ -920,6 +921,15 @@ interface SequenceExpression <: Expression { A sequence expression, i.e., a comma-separated sequence of expressions. +## DoExpression + +```js +interface DoExpression <: Expression { + type: "DoExpression"; + body: BlockStatement +} +``` + # Template Literals ## TemplateLiteral From 0b7da509d97ca6bb8c97a4012417581d05854d1d Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 4 Mar 2017 21:00:10 +0100 Subject: [PATCH 035/105] Add estree test for correct order of directives --- .../estree/directives/program-order/actual.js | 3 + .../directives/program-order/expected.json | 150 ++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 test/fixtures/estree/directives/program-order/actual.js create mode 100644 test/fixtures/estree/directives/program-order/expected.json diff --git a/test/fixtures/estree/directives/program-order/actual.js b/test/fixtures/estree/directives/program-order/actual.js new file mode 100644 index 0000000000..43e689ef2a --- /dev/null +++ b/test/fixtures/estree/directives/program-order/actual.js @@ -0,0 +1,3 @@ +"use strict"; +"use loose"; +var a; diff --git a/test/fixtures/estree/directives/program-order/expected.json b/test/fixtures/estree/directives/program-order/expected.json new file mode 100644 index 0000000000..2f58e0a7a4 --- /dev/null +++ b/test/fixtures/estree/directives/program-order/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "Literal", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": "use strict", + "raw": "\"use strict\"" + }, + "directive": "use strict" + }, + { + "type": "ExpressionStatement", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "expression": { + "type": "Literal", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "value": "use loose", + "raw": "\"use loose\"" + }, + "directive": "use loose" + }, + { + "type": "VariableDeclaration", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": null + } + ], + "kind": "var" + } + ] + } +} \ No newline at end of file From c7492454ca1e2cdee303ce509bad6a8d643ccd4b Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sun, 5 Mar 2017 13:53:48 +0100 Subject: [PATCH 036/105] chore(package): update flow-bin to version 0.41.0 (#395) https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f4d27e98fe..9157cb7394 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.20.0", - "flow-bin": "^0.40.0", + "flow-bin": "^0.41.0", "nyc": "^10.0.0", "rimraf": "^2.5.4", "rollup": "^0.41.0", From 5e0dc7a68951f6b2514f74a7f2a89903d008f583 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 8 Mar 2017 08:43:49 -0500 Subject: [PATCH 037/105] add version badge [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 892fbc4995..57d971ad03 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@

+ NPM Version Travis Status Codecov Status

From 7a6d495704d4d86189ef13195ad3115cca8f5bbc Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 8 Mar 2017 09:34:22 -0600 Subject: [PATCH 038/105] Throw error if new.target is used outside of a function (#402) --- src/parser/expression.js | 8 +- .../es2015/uncategorised/336/expected.json | 95 ----------- .../es2015/uncategorised/336/options.json | 3 + .../es2015/uncategorised/394/actual.js | 1 + .../es2015/uncategorised/394/expected.json | 152 ++++++++++++++++++ 5 files changed, 163 insertions(+), 96 deletions(-) delete mode 100644 test/fixtures/es2015/uncategorised/336/expected.json create mode 100644 test/fixtures/es2015/uncategorised/336/options.json create mode 100644 test/fixtures/es2015/uncategorised/394/actual.js create mode 100644 test/fixtures/es2015/uncategorised/394/expected.json diff --git a/src/parser/expression.js b/src/parser/expression.js index eecf29a3fa..5ec827549e 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -662,7 +662,13 @@ pp.parseNew = function () { const meta = this.parseIdentifier(true); if (this.eat(tt.dot)) { - return this.parseMetaProperty(node, meta, "target"); + const metaProp = this.parseMetaProperty(node, meta, "target"); + + if (!this.state.inFunction) { + this.raise(metaProp.property.start, "new.target can only be used in functions"); + } + + return metaProp; } node.callee = this.parseNoCallExpr(); diff --git a/test/fixtures/es2015/uncategorised/336/expected.json b/test/fixtures/es2015/uncategorised/336/expected.json deleted file mode 100644 index 9822daf8c2..0000000000 --- a/test/fixtures/es2015/uncategorised/336/expected.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "expression": { - "type": "MetaProperty", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "meta": { - "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "name": "new" - }, - "property": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "target" - } - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/336/options.json b/test/fixtures/es2015/uncategorised/336/options.json new file mode 100644 index 0000000000..abb78cbdb2 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/336/options.json @@ -0,0 +1,3 @@ +{ + "throws": "new.target can only be used in functions (1:4)" +} diff --git a/test/fixtures/es2015/uncategorised/394/actual.js b/test/fixtures/es2015/uncategorised/394/actual.js new file mode 100644 index 0000000000..a83d19f0f8 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/394/actual.js @@ -0,0 +1 @@ +function foo() { new.target } diff --git a/test/fixtures/es2015/uncategorised/394/expected.json b/test/fixtures/es2015/uncategorised/394/expected.json new file mode 100644 index 0000000000..30b0e8ac73 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/394/expected.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "MetaProperty", + "start": 17, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "meta": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "target" + }, + "name": "target" + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file From 81056eeee766817472f2a414a51196f277ba9900 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Fri, 10 Mar 2017 03:43:45 -0800 Subject: [PATCH 039/105] Fix parsing of class properties (#351) --- src/parser/statement.js | 177 +- src/plugins/flow.js | 17 +- .../actual.js | 3 + .../options.json | 3 + .../es2015/class-methods/linebreaks/actual.js | 42 + .../class-methods/linebreaks/expected.json | 690 ++++++++ .../class-methods/tricky-names/actual.js | 45 + .../class-methods/tricky-names/expected.json | 711 ++++++++ .../async-functions/no-method-asi/actual.js | 4 + .../no-method-asi/options.json | 3 + .../invalid-syntax/migrated_0268/options.json | 2 +- .../invalid-syntax/migrated_0275/options.json | 2 +- .../invalid-syntax/migrated_0276/options.json | 2 +- .../async-generators/class-method-2/actual.js | 4 + .../class-method-2/expected.json | 141 ++ .../class-method-no-asi/actual.js | 4 + .../class-method-no-asi/options.json | 3 + .../disallow-decorator/actual.js | 4 + .../disallow-decorator/options.json | 4 + .../disallow-duplicate/actual.js | 4 + .../disallow-duplicate/options.json | 3 + .../illegal-key/options.json | 2 +- .../asi-failure-inline/actual.js | 3 + .../asi-failure-inline/options.json | 4 + .../class-properties/edge-cases/actual.js | 50 + .../class-properties/edge-cases/expected.json | 1496 +++++++++++++++++ .../class-properties/edge-cases/options.json | 3 + .../class-properties/inline/actual.js | 3 + .../class-properties/inline/expected.json | 312 ++++ .../class-properties/inline/options.json | 3 + .../class-properties/no-ctor-2/actual.js | 4 + .../class-properties/no-ctor-2/options.json | 4 + .../class-properties/no-ctor/actual.js | 3 + .../class-properties/no-ctor/options.json | 4 + .../no-static-prototype-2/actual.js | 4 + .../no-static-prototype-2/options.json | 4 + .../no-static-prototype/actual.js | 3 + .../no-static-prototype/options.json | 4 + .../export-decorators-on-class/actual.js | 2 + .../export-decorators-on-class/expected.json | 116 ++ .../export-decorators-on-class/options.json | 3 + .../no-constructor-decorators/actual.js | 4 + .../no-constructor-decorators/options.json | 3 + .../actual.js | 2 + .../options.json | 4 + .../decorators/no-export-decorators/actual.js | 2 + .../no-export-decorators/options.json | 4 + 47 files changed, 3820 insertions(+), 94 deletions(-) create mode 100644 test/fixtures/es2015/class-methods/disallow-static-generator-prototype/actual.js create mode 100644 test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json create mode 100644 test/fixtures/es2015/class-methods/linebreaks/actual.js create mode 100644 test/fixtures/es2015/class-methods/linebreaks/expected.json create mode 100644 test/fixtures/es2015/class-methods/tricky-names/actual.js create mode 100644 test/fixtures/es2015/class-methods/tricky-names/expected.json create mode 100644 test/fixtures/es2017/async-functions/no-method-asi/actual.js create mode 100644 test/fixtures/es2017/async-functions/no-method-asi/options.json create mode 100644 test/fixtures/experimental/async-generators/class-method-2/actual.js create mode 100644 test/fixtures/experimental/async-generators/class-method-2/expected.json create mode 100644 test/fixtures/experimental/async-generators/class-method-no-asi/actual.js create mode 100644 test/fixtures/experimental/async-generators/class-method-no-asi/options.json create mode 100644 test/fixtures/experimental/class-constructor-call/disallow-decorator/actual.js create mode 100644 test/fixtures/experimental/class-constructor-call/disallow-decorator/options.json create mode 100644 test/fixtures/experimental/class-constructor-call/disallow-duplicate/actual.js create mode 100644 test/fixtures/experimental/class-constructor-call/disallow-duplicate/options.json create mode 100644 test/fixtures/experimental/class-properties/asi-failure-inline/actual.js create mode 100644 test/fixtures/experimental/class-properties/asi-failure-inline/options.json create mode 100644 test/fixtures/experimental/class-properties/edge-cases/actual.js create mode 100644 test/fixtures/experimental/class-properties/edge-cases/expected.json create mode 100644 test/fixtures/experimental/class-properties/edge-cases/options.json create mode 100644 test/fixtures/experimental/class-properties/inline/actual.js create mode 100644 test/fixtures/experimental/class-properties/inline/expected.json create mode 100644 test/fixtures/experimental/class-properties/inline/options.json create mode 100644 test/fixtures/experimental/class-properties/no-ctor-2/actual.js create mode 100644 test/fixtures/experimental/class-properties/no-ctor-2/options.json create mode 100644 test/fixtures/experimental/class-properties/no-ctor/actual.js create mode 100644 test/fixtures/experimental/class-properties/no-ctor/options.json create mode 100644 test/fixtures/experimental/class-properties/no-static-prototype-2/actual.js create mode 100644 test/fixtures/experimental/class-properties/no-static-prototype-2/options.json create mode 100644 test/fixtures/experimental/class-properties/no-static-prototype/actual.js create mode 100644 test/fixtures/experimental/class-properties/no-static-prototype/options.json create mode 100644 test/fixtures/experimental/decorators/export-decorators-on-class/actual.js create mode 100644 test/fixtures/experimental/decorators/export-decorators-on-class/expected.json create mode 100644 test/fixtures/experimental/decorators/export-decorators-on-class/options.json create mode 100644 test/fixtures/experimental/decorators/no-constructor-decorators/actual.js create mode 100644 test/fixtures/experimental/decorators/no-constructor-decorators/options.json create mode 100644 test/fixtures/experimental/decorators/no-export-decorators-without-class/actual.js create mode 100644 test/fixtures/experimental/decorators/no-export-decorators-without-class/options.json create mode 100644 test/fixtures/experimental/decorators/no-export-decorators/actual.js create mode 100644 test/fixtures/experimental/decorators/no-export-decorators/options.json diff --git a/src/parser/statement.js b/src/parser/statement.js index f7f950574a..03fc2aaac3 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -625,11 +625,18 @@ pp.parseClass = function (node, isStatement, optionalId) { }; pp.isClassProperty = function () { - return this.match(tt.eq) || this.isLineTerminator(); + return this.match(tt.eq) || this.match(tt.semi) || this.match(tt.braceR); }; -pp.isClassMutatorStarter = function () { - return false; +pp.isClassMethod = function () { + return this.match(tt.parenL); +}; + +pp.isNonstaticConstructor = function (method) { + return !method.computed && !method.static && ( + (method.key.name === "constructor") || // Identifier + (method.key.value === "constructor") // Literal + ); }; pp.parseClassBody = function (node) { @@ -667,92 +674,102 @@ pp.parseClassBody = function (node) { decorators = []; } - let isConstructorCall = false; - const isMaybeStatic = this.match(tt.name) && this.state.value === "static"; - let isGenerator = this.eat(tt.star); - let isGetSet = false; - let isAsync = false; - - this.parsePropertyName(method); - - method.static = isMaybeStatic && !this.match(tt.parenL); - if (method.static) { - isGenerator = this.eat(tt.star); - this.parsePropertyName(method); - } - - if (!isGenerator) { - if (this.isClassProperty()) { + method.static = false; + if (this.match(tt.name) && this.state.value === "static") { + const key = this.parseIdentifier(true); // eats 'static' + if (this.isClassMethod()) { + // a method named 'static' + method.kind = "method"; + method.computed = false; + method.key = key; + this.parseClassMethod(classBody, method, false, false); + continue; + } else if (this.isClassProperty()) { + // a property named 'static' + method.computed = false; + method.key = key; classBody.body.push(this.parseClassProperty(method)); continue; } - - if (method.key.type === "Identifier" && !method.computed && this.hasPlugin("classConstructorCall") && method.key.name === "call" && this.match(tt.name) && this.state.value === "constructor") { - isConstructorCall = true; - this.parsePropertyName(method); - } + // otherwise something static + method.static = true; } - const isAsyncMethod = !this.match(tt.parenL) && !method.computed && method.key.type === "Identifier" && method.key.name === "async"; - if (isAsyncMethod) { - if (this.hasPlugin("asyncGenerators") && this.eat(tt.star)) isGenerator = true; - isAsync = true; + if (this.eat(tt.star)) { + // a generator + method.kind = "method"; this.parsePropertyName(method); - } - - method.kind = "method"; - - if (!method.computed) { - let { key } = method; - - // handle get/set methods - // eg. class Foo { get bar() {} set bar() {} } - if (!isAsync && !isGenerator && !this.isClassMutatorStarter() && key.type === "Identifier" && !this.match(tt.parenL) && (key.name === "get" || key.name === "set")) { - isGetSet = true; - method.kind = key.name; - key = this.parsePropertyName(method); + if (this.isNonstaticConstructor(method)) { + this.raise(method.key.start, "Constructor can't be a generator"); } - - // disallow invalid constructors - const isConstructor = !isConstructorCall && !method.static && ( - (key.name === "constructor") || // Identifier - (key.value === "constructor") // Literal - ); - if (isConstructor) { - if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class"); - if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier"); - if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); - if (isAsync) this.raise(key.start, "Constructor can't be an async function"); - method.kind = "constructor"; - hadConstructor = true; + if (!method.computed && method.static && (method.key.name === "prototype" || method.key.value === "prototype")) { + this.raise(method.key.start, "Classes may not have static property named prototype"); } - - // disallow static prototype method - const isStaticPrototype = method.static && ( - (key.name === "prototype") || // Identifier - (key.value === "prototype") // Literal - ); - if (isStaticPrototype) { - this.raise(key.start, "Classes may not have static property named prototype"); + this.parseClassMethod(classBody, method, true, false); + } else { + const isSimple = this.match(tt.name); + const key = this.parsePropertyName(method); + if (!method.computed && method.static && (method.key.name === "prototype" || method.key.value === "prototype")) { + this.raise(method.key.start, "Classes may not have static property named prototype"); + } + if (this.isClassMethod()) { + // a normal method + if (this.isNonstaticConstructor(method)) { + if (hadConstructor) { + this.raise(key.start, "Duplicate constructor in the same class"); + } else if (method.decorators) { + this.raise(method.start, "You can't attach decorators to a class constructor"); + } + hadConstructor = true; + method.kind = "constructor"; + } else { + method.kind = "method"; + } + this.parseClassMethod(classBody, method, false, false); + } else if (this.isClassProperty()) { + // a normal property + if (this.isNonstaticConstructor(method)) { + this.raise(method.key.start, "Classes may not have a non-static field named 'constructor'"); + } + classBody.body.push(this.parseClassProperty(method)); + } else if (isSimple && key.name === "async" && !this.isLineTerminator()) { + // an async method + const isGenerator = this.hasPlugin("asyncGenerators") && this.eat(tt.star); + method.kind = "method"; + this.parsePropertyName(method); + if (this.isNonstaticConstructor(method)) { + this.raise(method.key.start, "Constructor can't be an async function"); + } + this.parseClassMethod(classBody, method, isGenerator, true); + } else if (isSimple && (key.name === "get" || key.name === "set") && !(this.isLineTerminator() && this.match(tt.star))) { // `get\n*` is an uninitialized property named 'get' followed by a generator. + // a getter or setter + method.kind = key.name; + this.parsePropertyName(method); + if (this.isNonstaticConstructor(method)) { + this.raise(method.key.start, "Constructor can't have get/set modifier"); + } + this.parseClassMethod(classBody, method, false, false); + this.checkGetterSetterParamCount(method); + } else if (this.hasPlugin("classConstructorCall") && isSimple && key.name === "call" && this.match(tt.name) && this.state.value === "constructor") { + // a (deprecated) call constructor + if (hadConstructorCall) { + this.raise(method.start, "Duplicate constructor call in the same class"); + } else if (method.decorators) { + this.raise(method.start, "You can't attach decorators to a class constructor"); + } + hadConstructorCall = true; + method.kind = "constructorCall"; + this.parsePropertyName(method); // consume "constructor" and make it the method's name + this.parseClassMethod(classBody, method, false, false); + } else if (this.isLineTerminator()) { + // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token) + if (this.isNonstaticConstructor(method)) { + this.raise(method.key.start, "Classes may not have a non-static field named 'constructor'"); + } + classBody.body.push(this.parseClassProperty(method)); + } else { + this.unexpected(); } - } - - // convert constructor to a constructor call - if (isConstructorCall) { - if (hadConstructorCall) this.raise(method.start, "Duplicate constructor call in the same class"); - method.kind = "constructorCall"; - hadConstructorCall = true; - } - - // disallow decorators on class constructors - if ((method.kind === "constructor" || method.kind === "constructorCall") && method.decorators) { - this.raise(method.start, "You can't attach decorators to a class constructor"); - } - - this.parseClassMethod(classBody, method, isGenerator, isAsync); - - if (isGetSet) { - this.checkGetterSetterParamCount(method); } } diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 330a5f3591..d30545b113 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -1109,6 +1109,13 @@ export default function (instance) { }; }); + // determine whether or not we're currently in the position where a class method would appear + instance.extend("isClassMethod", function (inner) { + return function () { + return this.isRelational("<") || inner.call(this); + }; + }); + // determine whether or not we're currently in the position where a class property would appear instance.extend("isClassProperty", function (inner) { return function () { @@ -1439,14 +1446,4 @@ export default function (instance) { return this.match(tt.colon) || inner.call(this); }; }); - - instance.extend("isClassMutatorStarter", function (inner) { - return function () { - if (this.isRelational("<")) { - return true; - } else { - return inner.call(this); - } - }; - }); } diff --git a/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/actual.js b/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/actual.js new file mode 100644 index 0000000000..d96088851c --- /dev/null +++ b/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/actual.js @@ -0,0 +1,3 @@ +class A { + static *prototype() {} +} \ No newline at end of file diff --git a/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json b/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json new file mode 100644 index 0000000000..00c025e551 --- /dev/null +++ b/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Classes may not have static property named prototype (2:10)" +} \ No newline at end of file diff --git a/test/fixtures/es2015/class-methods/linebreaks/actual.js b/test/fixtures/es2015/class-methods/linebreaks/actual.js new file mode 100644 index 0000000000..4c68e68f03 --- /dev/null +++ b/test/fixtures/es2015/class-methods/linebreaks/actual.js @@ -0,0 +1,42 @@ +class A { + get + a + () {} + + set + a + (a) {} + + constructor + () {} + + a + () {} + + * + a + () {} + + static + get + a + () {} + + static + set + a + (a) {} + + static + constructor + () {} + + static + a + () {} + + static + * + a + () {} +} \ No newline at end of file diff --git a/test/fixtures/es2015/class-methods/linebreaks/expected.json b/test/fixtures/es2015/class-methods/linebreaks/expected.json new file mode 100644 index 0000000000..62dcad3c53 --- /dev/null +++ b/test/fixtures/es2015/class-methods/linebreaks/expected.json @@ -0,0 +1,690 @@ +{ + "type": "File", + "start": 0, + "end": 239, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 42, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 239, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 42, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 239, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 42, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 239, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 42, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "static": false, + "kind": "get", + "computed": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 31, + "end": 47, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "static": false, + "kind": "set", + "computed": false, + "key": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 8, + "column": 3 + }, + "end": { + "line": 8, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 8 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 51, + "end": 70, + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 51, + "end": 62, + "loc": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 10, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "kind": "constructor", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 68, + "end": 70, + "loc": { + "start": { + "line": 11, + "column": 5 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 74, + "end": 83, + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 74, + "end": 75, + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 81, + "end": 83, + "loc": { + "start": { + "line": 14, + "column": 5 + }, + "end": { + "line": 14, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 87, + "end": 100, + "loc": { + "start": { + "line": 16, + "column": 2 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "static": false, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 91, + "end": 92, + "loc": { + "start": { + "line": 17, + "column": 2 + }, + "end": { + "line": 17, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "id": null, + "generator": true, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 98, + "end": 100, + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 104, + "end": 128, + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 23, + "column": 7 + } + }, + "static": true, + "kind": "get", + "computed": false, + "key": { + "type": "Identifier", + "start": 119, + "end": 120, + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 22, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 126, + "end": 128, + "loc": { + "start": { + "line": 23, + "column": 5 + }, + "end": { + "line": 23, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 132, + "end": 157, + "loc": { + "start": { + "line": 25, + "column": 2 + }, + "end": { + "line": 28, + "column": 8 + } + }, + "static": true, + "kind": "set", + "computed": false, + "key": { + "type": "Identifier", + "start": 147, + "end": 148, + "loc": { + "start": { + "line": 27, + "column": 2 + }, + "end": { + "line": 27, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 152, + "end": 153, + "loc": { + "start": { + "line": 28, + "column": 3 + }, + "end": { + "line": 28, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 155, + "end": 157, + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 28, + "column": 8 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 161, + "end": 189, + "loc": { + "start": { + "line": 30, + "column": 2 + }, + "end": { + "line": 32, + "column": 7 + } + }, + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 170, + "end": 181, + "loc": { + "start": { + "line": 31, + "column": 2 + }, + "end": { + "line": 31, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 187, + "end": 189, + "loc": { + "start": { + "line": 32, + "column": 5 + }, + "end": { + "line": 32, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 193, + "end": 211, + "loc": { + "start": { + "line": 34, + "column": 2 + }, + "end": { + "line": 36, + "column": 7 + } + }, + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 202, + "end": 203, + "loc": { + "start": { + "line": 35, + "column": 2 + }, + "end": { + "line": 35, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 209, + "end": 211, + "loc": { + "start": { + "line": 36, + "column": 5 + }, + "end": { + "line": 36, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 215, + "end": 237, + "loc": { + "start": { + "line": 38, + "column": 2 + }, + "end": { + "line": 41, + "column": 7 + } + }, + "static": true, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 228, + "end": 229, + "loc": { + "start": { + "line": 40, + "column": 2 + }, + "end": { + "line": 40, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "id": null, + "generator": true, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 235, + "end": 237, + "loc": { + "start": { + "line": 41, + "column": 5 + }, + "end": { + "line": 41, + "column": 7 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/class-methods/tricky-names/actual.js b/test/fixtures/es2015/class-methods/tricky-names/actual.js new file mode 100644 index 0000000000..35e8ddeefe --- /dev/null +++ b/test/fixtures/es2015/class-methods/tricky-names/actual.js @@ -0,0 +1,45 @@ +class A { + get + () {} + + set + () {} + + static + () {} + + async + () {} + + + static + get + () {} + + static + set + () {} + + static + static + () {} + + static + async + () {} + + static + a + () {} + + + get + async + () {} + + + static + get + static + () {} +} \ No newline at end of file diff --git a/test/fixtures/es2015/class-methods/tricky-names/expected.json b/test/fixtures/es2015/class-methods/tricky-names/expected.json new file mode 100644 index 0000000000..27b74a271b --- /dev/null +++ b/test/fixtures/es2015/class-methods/tricky-names/expected.json @@ -0,0 +1,711 @@ +{ + "type": "File", + "start": 0, + "end": 257, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 45, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 257, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 45, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 257, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 45, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 257, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 45, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "static": false, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "get" + }, + "name": "get" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 27, + "end": 38, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "static": false, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + }, + "identifierName": "set" + }, + "name": "set" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 42, + "end": 56, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "static": false, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 42, + "end": 48, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 8 + }, + "identifierName": "static" + }, + "name": "static" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 56, + "loc": { + "start": { + "line": 9, + "column": 5 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 60, + "end": 73, + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "static": false, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 60, + "end": 65, + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 7 + }, + "identifierName": "async" + }, + "name": "async" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 71, + "end": 73, + "loc": { + "start": { + "line": 12, + "column": 5 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 78, + "end": 98, + "loc": { + "start": { + "line": 15, + "column": 2 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "static": true, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 87, + "end": 90, + "loc": { + "start": { + "line": 16, + "column": 2 + }, + "end": { + "line": 16, + "column": 5 + }, + "identifierName": "get" + }, + "name": "get" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 96, + "end": 98, + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 102, + "end": 122, + "loc": { + "start": { + "line": 19, + "column": 2 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "static": true, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 111, + "end": 114, + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 20, + "column": 5 + }, + "identifierName": "set" + }, + "name": "set" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 120, + "end": 122, + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 126, + "end": 149, + "loc": { + "start": { + "line": 23, + "column": 2 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 135, + "end": 141, + "loc": { + "start": { + "line": 24, + "column": 2 + }, + "end": { + "line": 24, + "column": 8 + }, + "identifierName": "static" + }, + "name": "static" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 147, + "end": 149, + "loc": { + "start": { + "line": 25, + "column": 5 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 153, + "end": 175, + "loc": { + "start": { + "line": 27, + "column": 2 + }, + "end": { + "line": 29, + "column": 7 + } + }, + "static": true, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 162, + "end": 167, + "loc": { + "start": { + "line": 28, + "column": 2 + }, + "end": { + "line": 28, + "column": 7 + }, + "identifierName": "async" + }, + "name": "async" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 173, + "end": 175, + "loc": { + "start": { + "line": 29, + "column": 5 + }, + "end": { + "line": 29, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 179, + "end": 197, + "loc": { + "start": { + "line": 31, + "column": 2 + }, + "end": { + "line": 33, + "column": 7 + } + }, + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 188, + "end": 189, + "loc": { + "start": { + "line": 32, + "column": 2 + }, + "end": { + "line": 32, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 195, + "end": 197, + "loc": { + "start": { + "line": 33, + "column": 5 + }, + "end": { + "line": 33, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 202, + "end": 221, + "loc": { + "start": { + "line": 36, + "column": 2 + }, + "end": { + "line": 38, + "column": 7 + } + }, + "static": false, + "kind": "get", + "computed": false, + "key": { + "type": "Identifier", + "start": 208, + "end": 213, + "loc": { + "start": { + "line": 37, + "column": 2 + }, + "end": { + "line": 37, + "column": 7 + }, + "identifierName": "async" + }, + "name": "async" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 219, + "end": 221, + "loc": { + "start": { + "line": 38, + "column": 5 + }, + "end": { + "line": 38, + "column": 7 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 226, + "end": 255, + "loc": { + "start": { + "line": 41, + "column": 2 + }, + "end": { + "line": 44, + "column": 7 + } + }, + "static": true, + "kind": "get", + "computed": false, + "key": { + "type": "Identifier", + "start": 241, + "end": 247, + "loc": { + "start": { + "line": 43, + "column": 2 + }, + "end": { + "line": 43, + "column": 8 + }, + "identifierName": "static" + }, + "name": "static" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 253, + "end": 255, + "loc": { + "start": { + "line": 44, + "column": 5 + }, + "end": { + "line": 44, + "column": 7 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/no-method-asi/actual.js b/test/fixtures/es2017/async-functions/no-method-asi/actual.js new file mode 100644 index 0000000000..3ed61ad65f --- /dev/null +++ b/test/fixtures/es2017/async-functions/no-method-asi/actual.js @@ -0,0 +1,4 @@ +class A { + async + a(){} +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/no-method-asi/options.json b/test/fixtures/es2017/async-functions/no-method-asi/options.json new file mode 100644 index 0000000000..af38bd1530 --- /dev/null +++ b/test/fixtures/es2017/async-functions/no-method-asi/options.json @@ -0,0 +1,3 @@ +{ + "throws": "You can only use Class Properties when the 'classProperties' plugin is enabled. (2:2)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json index 021ac49e5f..89bfc2d73f 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0268/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected ( (1:10)" + "throws": "Unexpected token (1:10)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0275/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0275/options.json index 609492567c..cb6c66081e 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0275/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0275/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected ( (1:11)" + "throws": "Unexpected token (1:11)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0276/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0276/options.json index cd71808039..562afcef48 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0276/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0276/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected ( (1:23)" + "throws": "Unexpected token (1:23)" } diff --git a/test/fixtures/experimental/async-generators/class-method-2/actual.js b/test/fixtures/experimental/async-generators/class-method-2/actual.js new file mode 100644 index 0000000000..fd3dc7f8ae --- /dev/null +++ b/test/fixtures/experimental/async-generators/class-method-2/actual.js @@ -0,0 +1,4 @@ +class A { + async * + a(){} +} diff --git a/test/fixtures/experimental/async-generators/class-method-2/expected.json b/test/fixtures/experimental/async-generators/class-method-2/expected.json new file mode 100644 index 0000000000..d0dfc49fa8 --- /dev/null +++ b/test/fixtures/experimental/async-generators/class-method-2/expected.json @@ -0,0 +1,141 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "static": false, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "id": null, + "generator": true, + "expression": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/async-generators/class-method-no-asi/actual.js b/test/fixtures/experimental/async-generators/class-method-no-asi/actual.js new file mode 100644 index 0000000000..4b42b64210 --- /dev/null +++ b/test/fixtures/experimental/async-generators/class-method-no-asi/actual.js @@ -0,0 +1,4 @@ +class A { + async + * a(){} +} diff --git a/test/fixtures/experimental/async-generators/class-method-no-asi/options.json b/test/fixtures/experimental/async-generators/class-method-no-asi/options.json new file mode 100644 index 0000000000..af38bd1530 --- /dev/null +++ b/test/fixtures/experimental/async-generators/class-method-no-asi/options.json @@ -0,0 +1,3 @@ +{ + "throws": "You can only use Class Properties when the 'classProperties' plugin is enabled. (2:2)" +} diff --git a/test/fixtures/experimental/class-constructor-call/disallow-decorator/actual.js b/test/fixtures/experimental/class-constructor-call/disallow-decorator/actual.js new file mode 100644 index 0000000000..c63f1e9880 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/disallow-decorator/actual.js @@ -0,0 +1,4 @@ +class Foo { + @dec + call constructor() {} +} diff --git a/test/fixtures/experimental/class-constructor-call/disallow-decorator/options.json b/test/fixtures/experimental/class-constructor-call/disallow-decorator/options.json new file mode 100644 index 0000000000..75152c7974 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/disallow-decorator/options.json @@ -0,0 +1,4 @@ +{ + "throws": "You can't attach decorators to a class constructor (3:2)", + "plugins": ["classConstructorCall", "decorators"] +} \ No newline at end of file diff --git a/test/fixtures/experimental/class-constructor-call/disallow-duplicate/actual.js b/test/fixtures/experimental/class-constructor-call/disallow-duplicate/actual.js new file mode 100644 index 0000000000..6fd5dd7d11 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/disallow-duplicate/actual.js @@ -0,0 +1,4 @@ +class Foo { + call constructor() {} + call constructor() {} +} diff --git a/test/fixtures/experimental/class-constructor-call/disallow-duplicate/options.json b/test/fixtures/experimental/class-constructor-call/disallow-duplicate/options.json new file mode 100644 index 0000000000..e13cd0e258 --- /dev/null +++ b/test/fixtures/experimental/class-constructor-call/disallow-duplicate/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Duplicate constructor call in the same class (3:2)" +} \ No newline at end of file diff --git a/test/fixtures/experimental/class-constructor-call/illegal-key/options.json b/test/fixtures/experimental/class-constructor-call/illegal-key/options.json index 606cbed9d9..4e84114247 100644 --- a/test/fixtures/experimental/class-constructor-call/illegal-key/options.json +++ b/test/fixtures/experimental/class-constructor-call/illegal-key/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected ( (2:7)" + "throws": "Unexpected token (2:7)" } diff --git a/test/fixtures/experimental/class-properties/asi-failure-inline/actual.js b/test/fixtures/experimental/class-properties/asi-failure-inline/actual.js new file mode 100644 index 0000000000..efddc05595 --- /dev/null +++ b/test/fixtures/experimental/class-properties/asi-failure-inline/actual.js @@ -0,0 +1,3 @@ +class Foo { + x y +} diff --git a/test/fixtures/experimental/class-properties/asi-failure-inline/options.json b/test/fixtures/experimental/class-properties/asi-failure-inline/options.json new file mode 100644 index 0000000000..2a11366381 --- /dev/null +++ b/test/fixtures/experimental/class-properties/asi-failure-inline/options.json @@ -0,0 +1,4 @@ +{ + "throws": "Unexpected token (2:4)", + "plugins": ["classProperties"] +} diff --git a/test/fixtures/experimental/class-properties/edge-cases/actual.js b/test/fixtures/experimental/class-properties/edge-cases/actual.js new file mode 100644 index 0000000000..539a3ccff8 --- /dev/null +++ b/test/fixtures/experimental/class-properties/edge-cases/actual.js @@ -0,0 +1,50 @@ +class A1 { + static + a + static +} + +class A2 { a } +class A3 { get } +class A4 { set } +class A5 { static } +class A6 { async } + +class A7 { + get + *a(){} +} + +class A8 { + static + *a(){} +} + +class A9 { + async + a(){} +} + +class A10 { + static + async + a +} + +class A11 { static; } + +class A12 { + static = 0; +} + +class A13 { + get + ['a'](){} +} + +class A14 { + static + get + static + (){} +} \ No newline at end of file diff --git a/test/fixtures/experimental/class-properties/edge-cases/expected.json b/test/fixtures/experimental/class-properties/edge-cases/expected.json new file mode 100644 index 0000000000..3a41800a0b --- /dev/null +++ b/test/fixtures/experimental/class-properties/edge-cases/expected.json @@ -0,0 +1,1496 @@ +{ + "type": "File", + "start": 0, + "end": 381, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 50, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 381, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 50, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "A1" + }, + "name": "A1" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 9, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": null + }, + { + "type": "ClassProperty", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + }, + "identifierName": "static" + }, + "name": "static" + }, + "value": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 36, + "end": 50, + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 8 + }, + "identifierName": "A2" + }, + "name": "A2" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 45, + "end": 50, + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 51, + "end": 67, + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 57, + "end": 59, + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 8 + }, + "identifierName": "A3" + }, + "name": "A3" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 60, + "end": 67, + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 62, + "end": 65, + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 14 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 62, + "end": 65, + "loc": { + "start": { + "line": 8, + "column": 11 + }, + "end": { + "line": 8, + "column": 14 + }, + "identifierName": "get" + }, + "name": "get" + }, + "value": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 68, + "end": 84, + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 74, + "end": 76, + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 8 + }, + "identifierName": "A4" + }, + "name": "A4" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 77, + "end": 84, + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 16 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 79, + "end": 82, + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 79, + "end": 82, + "loc": { + "start": { + "line": 9, + "column": 11 + }, + "end": { + "line": 9, + "column": 14 + }, + "identifierName": "set" + }, + "name": "set" + }, + "value": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 85, + "end": 104, + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 91, + "end": 93, + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 8 + }, + "identifierName": "A5" + }, + "name": "A5" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 94, + "end": 104, + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 19 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 96, + "end": 102, + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 17 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 96, + "end": 102, + "loc": { + "start": { + "line": 10, + "column": 11 + }, + "end": { + "line": 10, + "column": 17 + }, + "identifierName": "static" + }, + "name": "static" + }, + "value": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 105, + "end": 123, + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 111, + "end": 113, + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 8 + }, + "identifierName": "A6" + }, + "name": "A6" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 114, + "end": 123, + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 18 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 116, + "end": 121, + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 16 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 116, + "end": 121, + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 16 + }, + "identifierName": "async" + }, + "name": "async" + }, + "value": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 125, + "end": 152, + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 16, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 131, + "end": 133, + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 8 + }, + "identifierName": "A7" + }, + "name": "A7" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 134, + "end": 152, + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 16, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 138, + "end": 141, + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 5 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 138, + "end": 141, + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 5 + }, + "identifierName": "get" + }, + "name": "get" + }, + "value": null + }, + { + "type": "ClassMethod", + "start": 144, + "end": 150, + "loc": { + "start": { + "line": 15, + "column": 2 + }, + "end": { + "line": 15, + "column": 8 + } + }, + "static": false, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 145, + "end": 146, + "loc": { + "start": { + "line": 15, + "column": 3 + }, + "end": { + "line": 15, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + }, + "id": null, + "generator": true, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 148, + "end": 150, + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 8 + } + }, + "body": [], + "directives": [] + } + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 154, + "end": 184, + "loc": { + "start": { + "line": 18, + "column": 0 + }, + "end": { + "line": 21, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 160, + "end": 162, + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 8 + }, + "identifierName": "A8" + }, + "name": "A8" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 163, + "end": 184, + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 21, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 167, + "end": 182, + "loc": { + "start": { + "line": 19, + "column": 2 + }, + "end": { + "line": 20, + "column": 8 + } + }, + "static": true, + "kind": "method", + "computed": false, + "key": { + "type": "Identifier", + "start": 177, + "end": 178, + "loc": { + "start": { + "line": 20, + "column": 3 + }, + "end": { + "line": 20, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + }, + "id": null, + "generator": true, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 180, + "end": 182, + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 8 + } + }, + "body": [], + "directives": [] + } + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 186, + "end": 214, + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 26, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 192, + "end": 194, + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 8 + }, + "identifierName": "A9" + }, + "name": "A9" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 195, + "end": 214, + "loc": { + "start": { + "line": 23, + "column": 9 + }, + "end": { + "line": 26, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 199, + "end": 204, + "loc": { + "start": { + "line": 24, + "column": 2 + }, + "end": { + "line": 24, + "column": 7 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 199, + "end": 204, + "loc": { + "start": { + "line": 24, + "column": 2 + }, + "end": { + "line": 24, + "column": 7 + }, + "identifierName": "async" + }, + "name": "async" + }, + "value": null + }, + { + "type": "ClassMethod", + "start": 207, + "end": 212, + "loc": { + "start": { + "line": 25, + "column": 2 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 207, + "end": 208, + "loc": { + "start": { + "line": 25, + "column": 2 + }, + "end": { + "line": 25, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 210, + "end": 212, + "loc": { + "start": { + "line": 25, + "column": 5 + }, + "end": { + "line": 25, + "column": 7 + } + }, + "body": [], + "directives": [] + } + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 216, + "end": 250, + "loc": { + "start": { + "line": 28, + "column": 0 + }, + "end": { + "line": 32, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 222, + "end": 225, + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 28, + "column": 9 + }, + "identifierName": "A10" + }, + "name": "A10" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 226, + "end": 250, + "loc": { + "start": { + "line": 28, + "column": 10 + }, + "end": { + "line": 32, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 230, + "end": 244, + "loc": { + "start": { + "line": 29, + "column": 2 + }, + "end": { + "line": 30, + "column": 7 + } + }, + "static": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 239, + "end": 244, + "loc": { + "start": { + "line": 30, + "column": 2 + }, + "end": { + "line": 30, + "column": 7 + }, + "identifierName": "async" + }, + "name": "async" + }, + "value": null + }, + { + "type": "ClassProperty", + "start": 247, + "end": 248, + "loc": { + "start": { + "line": 31, + "column": 2 + }, + "end": { + "line": 31, + "column": 3 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 247, + "end": 248, + "loc": { + "start": { + "line": 31, + "column": 2 + }, + "end": { + "line": 31, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 252, + "end": 273, + "loc": { + "start": { + "line": 34, + "column": 0 + }, + "end": { + "line": 34, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 258, + "end": 261, + "loc": { + "start": { + "line": 34, + "column": 6 + }, + "end": { + "line": 34, + "column": 9 + }, + "identifierName": "A11" + }, + "name": "A11" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 262, + "end": 273, + "loc": { + "start": { + "line": 34, + "column": 10 + }, + "end": { + "line": 34, + "column": 21 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 264, + "end": 271, + "loc": { + "start": { + "line": 34, + "column": 12 + }, + "end": { + "line": 34, + "column": 19 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 264, + "end": 270, + "loc": { + "start": { + "line": 34, + "column": 12 + }, + "end": { + "line": 34, + "column": 18 + }, + "identifierName": "static" + }, + "name": "static" + }, + "value": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 275, + "end": 302, + "loc": { + "start": { + "line": 36, + "column": 0 + }, + "end": { + "line": 38, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 281, + "end": 284, + "loc": { + "start": { + "line": 36, + "column": 6 + }, + "end": { + "line": 36, + "column": 9 + }, + "identifierName": "A12" + }, + "name": "A12" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 285, + "end": 302, + "loc": { + "start": { + "line": 36, + "column": 10 + }, + "end": { + "line": 38, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 289, + "end": 300, + "loc": { + "start": { + "line": 37, + "column": 2 + }, + "end": { + "line": 37, + "column": 13 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 289, + "end": 295, + "loc": { + "start": { + "line": 37, + "column": 2 + }, + "end": { + "line": 37, + "column": 8 + }, + "identifierName": "static" + }, + "name": "static" + }, + "value": { + "type": "NumericLiteral", + "start": 298, + "end": 299, + "loc": { + "start": { + "line": 37, + "column": 11 + }, + "end": { + "line": 37, + "column": 12 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 304, + "end": 335, + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 43, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 310, + "end": 313, + "loc": { + "start": { + "line": 40, + "column": 6 + }, + "end": { + "line": 40, + "column": 9 + }, + "identifierName": "A13" + }, + "name": "A13" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 314, + "end": 335, + "loc": { + "start": { + "line": 40, + "column": 10 + }, + "end": { + "line": 43, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 318, + "end": 333, + "loc": { + "start": { + "line": 41, + "column": 2 + }, + "end": { + "line": 42, + "column": 11 + } + }, + "static": false, + "kind": "get", + "computed": true, + "key": { + "type": "StringLiteral", + "start": 325, + "end": 328, + "loc": { + "start": { + "line": 42, + "column": 3 + }, + "end": { + "line": 42, + "column": 6 + } + }, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 331, + "end": 333, + "loc": { + "start": { + "line": 42, + "column": 9 + }, + "end": { + "line": 42, + "column": 11 + } + }, + "body": [], + "directives": [] + } + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 337, + "end": 381, + "loc": { + "start": { + "line": 45, + "column": 0 + }, + "end": { + "line": 50, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 343, + "end": 346, + "loc": { + "start": { + "line": 45, + "column": 6 + }, + "end": { + "line": 45, + "column": 9 + }, + "identifierName": "A14" + }, + "name": "A14" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 347, + "end": 381, + "loc": { + "start": { + "line": 45, + "column": 10 + }, + "end": { + "line": 50, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 351, + "end": 379, + "loc": { + "start": { + "line": 46, + "column": 2 + }, + "end": { + "line": 49, + "column": 6 + } + }, + "static": true, + "kind": "get", + "computed": false, + "key": { + "type": "Identifier", + "start": 366, + "end": 372, + "loc": { + "start": { + "line": 48, + "column": 2 + }, + "end": { + "line": 48, + "column": 8 + }, + "identifierName": "static" + }, + "name": "static" + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 377, + "end": 379, + "loc": { + "start": { + "line": 49, + "column": 4 + }, + "end": { + "line": 49, + "column": 6 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/class-properties/edge-cases/options.json b/test/fixtures/experimental/class-properties/edge-cases/options.json new file mode 100644 index 0000000000..9c27576d4a --- /dev/null +++ b/test/fixtures/experimental/class-properties/edge-cases/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classProperties"] +} diff --git a/test/fixtures/experimental/class-properties/inline/actual.js b/test/fixtures/experimental/class-properties/inline/actual.js new file mode 100644 index 0000000000..615a25ab4e --- /dev/null +++ b/test/fixtures/experimental/class-properties/inline/actual.js @@ -0,0 +1,3 @@ +class A { x; y; } + +class B { x = 0; y = 1; } diff --git a/test/fixtures/experimental/class-properties/inline/expected.json b/test/fixtures/experimental/class-properties/inline/expected.json new file mode 100644 index 0000000000..d5369121bb --- /dev/null +++ b/test/fixtures/experimental/class-properties/inline/expected.json @@ -0,0 +1,312 @@ +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": null + }, + { + "type": "ClassProperty", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "start": 19, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "B" + }, + "name": "B" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 27, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 25 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "NumericLiteral", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassProperty", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "static": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 18 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "NumericLiteral", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/class-properties/inline/options.json b/test/fixtures/experimental/class-properties/inline/options.json new file mode 100644 index 0000000000..9c27576d4a --- /dev/null +++ b/test/fixtures/experimental/class-properties/inline/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classProperties"] +} diff --git a/test/fixtures/experimental/class-properties/no-ctor-2/actual.js b/test/fixtures/experimental/class-properties/no-ctor-2/actual.js new file mode 100644 index 0000000000..a327a4a132 --- /dev/null +++ b/test/fixtures/experimental/class-properties/no-ctor-2/actual.js @@ -0,0 +1,4 @@ +class Foo { + constructor + *x(){} +} diff --git a/test/fixtures/experimental/class-properties/no-ctor-2/options.json b/test/fixtures/experimental/class-properties/no-ctor-2/options.json new file mode 100644 index 0000000000..9884529d32 --- /dev/null +++ b/test/fixtures/experimental/class-properties/no-ctor-2/options.json @@ -0,0 +1,4 @@ +{ + "throws": "Classes may not have a non-static field named 'constructor' (2:2)", + "plugins": ["classProperties"] +} diff --git a/test/fixtures/experimental/class-properties/no-ctor/actual.js b/test/fixtures/experimental/class-properties/no-ctor/actual.js new file mode 100644 index 0000000000..581943685f --- /dev/null +++ b/test/fixtures/experimental/class-properties/no-ctor/actual.js @@ -0,0 +1,3 @@ +class Foo { + constructor +} diff --git a/test/fixtures/experimental/class-properties/no-ctor/options.json b/test/fixtures/experimental/class-properties/no-ctor/options.json new file mode 100644 index 0000000000..9884529d32 --- /dev/null +++ b/test/fixtures/experimental/class-properties/no-ctor/options.json @@ -0,0 +1,4 @@ +{ + "throws": "Classes may not have a non-static field named 'constructor' (2:2)", + "plugins": ["classProperties"] +} diff --git a/test/fixtures/experimental/class-properties/no-static-prototype-2/actual.js b/test/fixtures/experimental/class-properties/no-static-prototype-2/actual.js new file mode 100644 index 0000000000..a7eb328656 --- /dev/null +++ b/test/fixtures/experimental/class-properties/no-static-prototype-2/actual.js @@ -0,0 +1,4 @@ +class Foo { + static prototype + *x(){} +} diff --git a/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json b/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json new file mode 100644 index 0000000000..5bde2716eb --- /dev/null +++ b/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json @@ -0,0 +1,4 @@ +{ + "throws": "Classes may not have static property named prototype (2:9)", + "plugins": ["classProperties"] +} diff --git a/test/fixtures/experimental/class-properties/no-static-prototype/actual.js b/test/fixtures/experimental/class-properties/no-static-prototype/actual.js new file mode 100644 index 0000000000..f7a9f68dfe --- /dev/null +++ b/test/fixtures/experimental/class-properties/no-static-prototype/actual.js @@ -0,0 +1,3 @@ +class Foo { + static prototype +} diff --git a/test/fixtures/experimental/class-properties/no-static-prototype/options.json b/test/fixtures/experimental/class-properties/no-static-prototype/options.json new file mode 100644 index 0000000000..5bde2716eb --- /dev/null +++ b/test/fixtures/experimental/class-properties/no-static-prototype/options.json @@ -0,0 +1,4 @@ +{ + "throws": "Classes may not have static property named prototype (2:9)", + "plugins": ["classProperties"] +} diff --git a/test/fixtures/experimental/decorators/export-decorators-on-class/actual.js b/test/fixtures/experimental/decorators/export-decorators-on-class/actual.js new file mode 100644 index 0000000000..51804c6056 --- /dev/null +++ b/test/fixtures/experimental/decorators/export-decorators-on-class/actual.js @@ -0,0 +1,2 @@ +@foo +export default class {} \ No newline at end of file diff --git a/test/fixtures/experimental/decorators/export-decorators-on-class/expected.json b/test/fixtures/experimental/decorators/export-decorators-on-class/expected.json new file mode 100644 index 0000000000..343060fcaf --- /dev/null +++ b/test/fixtures/experimental/decorators/export-decorators-on-class/expected.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 5, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "declaration": { + "type": "ClassDeclaration", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "body": [] + }, + "decorators": [ + { + "type": "Decorator", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Identifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/decorators/export-decorators-on-class/options.json b/test/fixtures/experimental/decorators/export-decorators-on-class/options.json new file mode 100644 index 0000000000..2104ca4328 --- /dev/null +++ b/test/fixtures/experimental/decorators/export-decorators-on-class/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/test/fixtures/experimental/decorators/no-constructor-decorators/actual.js b/test/fixtures/experimental/decorators/no-constructor-decorators/actual.js new file mode 100644 index 0000000000..4387084bbf --- /dev/null +++ b/test/fixtures/experimental/decorators/no-constructor-decorators/actual.js @@ -0,0 +1,4 @@ +class Foo { + @abc + constructor(){} +} diff --git a/test/fixtures/experimental/decorators/no-constructor-decorators/options.json b/test/fixtures/experimental/decorators/no-constructor-decorators/options.json new file mode 100644 index 0000000000..c0baef5996 --- /dev/null +++ b/test/fixtures/experimental/decorators/no-constructor-decorators/options.json @@ -0,0 +1,3 @@ +{ + "throws": "You can't attach decorators to a class constructor (3:2)" +} diff --git a/test/fixtures/experimental/decorators/no-export-decorators-without-class/actual.js b/test/fixtures/experimental/decorators/no-export-decorators-without-class/actual.js new file mode 100644 index 0000000000..c5a55d643f --- /dev/null +++ b/test/fixtures/experimental/decorators/no-export-decorators-without-class/actual.js @@ -0,0 +1,2 @@ +@foo +export default function f(){}; \ No newline at end of file diff --git a/test/fixtures/experimental/decorators/no-export-decorators-without-class/options.json b/test/fixtures/experimental/decorators/no-export-decorators-without-class/options.json new file mode 100644 index 0000000000..61c2c23daa --- /dev/null +++ b/test/fixtures/experimental/decorators/no-export-decorators-without-class/options.json @@ -0,0 +1,4 @@ +{ + "throws": "You can only use decorators on an export when exporting a class (2:0)", + "sourceType": "module" +} diff --git a/test/fixtures/experimental/decorators/no-export-decorators/actual.js b/test/fixtures/experimental/decorators/no-export-decorators/actual.js new file mode 100644 index 0000000000..4630d555a4 --- /dev/null +++ b/test/fixtures/experimental/decorators/no-export-decorators/actual.js @@ -0,0 +1,2 @@ +@foo +export default 0; \ No newline at end of file diff --git a/test/fixtures/experimental/decorators/no-export-decorators/options.json b/test/fixtures/experimental/decorators/no-export-decorators/options.json new file mode 100644 index 0000000000..61c2c23daa --- /dev/null +++ b/test/fixtures/experimental/decorators/no-export-decorators/options.json @@ -0,0 +1,4 @@ +{ + "throws": "You can only use decorators on an export when exporting a class (2:0)", + "sourceType": "module" +} From 250cd65479ae6a8169e9d42c1ceb0b76a8e6691f Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 10 Mar 2017 05:45:45 -0600 Subject: [PATCH 040/105] Fix watch command (#403) --- package.json | 3 +- yarn.lock | 103 ++++++++++++++++++++++++++++----------------------- 2 files changed, 59 insertions(+), 47 deletions(-) diff --git a/package.json b/package.json index 9157cb7394..9be5d32a92 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "rollup": "^0.41.0", "rollup-plugin-babel": "^2.6.1", "rollup-plugin-node-resolve": "^2.0.0", + "rollup-watch": "^3.2.2", "unicode-9.0.0": "~0.7.0" }, "bin": { @@ -59,7 +60,7 @@ "test-only": "ava", "test-ci": "nyc npm run test-only", "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'", - "watch": "npm run clean && cross-env BABEL_ENV=watch babel src --out-dir lib --watch" + "watch": "npm run clean && rollup -c --watch" }, "nyc": { "include": [ diff --git a/yarn.lock b/yarn.lock index a723d4659b..8c75b196b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,5 +1,7 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 + + "@ava/babel-preset-stage-4@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@ava/babel-preset-stage-4/-/babel-preset-stage-4-1.0.0.tgz#a613b5e152f529305422546b072d47facfb26291" @@ -42,14 +44,14 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - acorn@4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + ajv-keywords@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" @@ -330,7 +332,7 @@ babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@^6.17.0, babel-core@^6.23.0, babel-core@6: +babel-core@6, babel-core@^6.17.0, babel-core@^6.23.0: version "6.23.1" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.23.1.tgz#c143cb621bb2f621710c220c5d579d15b8a442df" dependencies: @@ -1541,7 +1543,7 @@ es6-set@~0.1.3: es6-symbol "3" event-emitter "~0.3.4" -es6-symbol@~3.1, es6-symbol@~3.1.0, es6-symbol@3: +es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" dependencies: @@ -1675,6 +1677,12 @@ event-emitter@~0.3.4: d "~0.1.1" es5-ext "~0.10.7" +execSync@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/execSync/-/execSync-1.0.2.tgz#1f42eda582225180053224ecdd3fd1960fdb3139" + dependencies: + temp "~0.5.1" + execa@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" @@ -1687,12 +1695,6 @@ execa@^0.5.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execSync@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/execSync/-/execSync-1.0.2.tgz#1f42eda582225180053224ecdd3fd1960fdb3139" - dependencies: - temp "~0.5.1" - exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" @@ -1795,9 +1797,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.40.0: - version "0.40.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.40.0.tgz#e10d60846d923124e47f548f16ba60fd8baff5a5" +flow-bin@^0.41.0: + version "0.41.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.41.0.tgz#8badac9a19da45004997e599bd316518db489b2e" fn-name@^2.0.0: version "2.0.1" @@ -2101,7 +2103,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@2: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -2314,7 +2316,7 @@ is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -isarray@^1.0.0, isarray@~1.0.0, isarray@1.0.0: +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2695,28 +2697,28 @@ minimatch@^3.0.0, minimatch@^3.0.2: dependencies: brace-expansion "^1.0.0" +minimist@0.0.8, minimist@~0.0.1: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -minimist@~0.0.1, minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -mkdirp@^0.5.0, mkdirp@^0.5.1, "mkdirp@>=0.5 0", mkdirp@~0.5.1: +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -ms@^0.7.1, ms@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" - ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" +ms@0.7.2, ms@^0.7.1: + version "0.7.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" + multimatch@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" @@ -3296,7 +3298,7 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@^2.79.0, request@>=2.42.0: +request@>=2.42.0, request@^2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" dependencies: @@ -3333,6 +3335,10 @@ require-precompiled@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/require-precompiled/-/require-precompiled-0.1.0.tgz#5a1b52eb70ebed43eb982e974c85ab59571e56fa" +require-relative@0.8.7: + version "0.8.7" + resolved "https://registry.yarnpkg.com/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de" + require-uncached@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" @@ -3354,14 +3360,14 @@ resolve-from@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" -resolve@^1.1.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" - resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" +resolve@^1.1.6: + version "1.2.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" + restore-cursor@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" @@ -3382,7 +3388,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@^2.5.4, rimraf@2: +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@^2.5.4: version "2.6.0" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.0.tgz#89b8a0fe432b9ff9ec9a925a00b6cdb3a91bbada" dependencies: @@ -3424,6 +3430,12 @@ rollup-pluginutils@^1.5.0: estree-walker "^0.2.1" minimatch "^3.0.2" +rollup-watch@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-3.2.2.tgz#5e574232e9ef36da9177f46946d8080cb267354b" + dependencies: + require-relative "0.8.7" + rollup@^0.41.0: version "0.41.4" resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.4.tgz#a970580176329f9ead86854d7fd4c46de752aef8" @@ -3446,7 +3458,7 @@ semver-diff@^2.0.0: dependencies: semver "^5.0.3" -semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@~5.3.0, "semver@2 || 3 || 4 || 5": +"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -3562,10 +3574,6 @@ stack-utils@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.0.tgz#2392cd8ddbd222492ed6c047960f7414b46c0f83" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -3581,6 +3589,10 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -3701,10 +3713,6 @@ text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - through2@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" @@ -3712,6 +3720,10 @@ through2@^2.0.0: readable-stream "^2.1.5" xtend "~4.0.1" +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + time-require@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/time-require/-/time-require-0.1.2.tgz#f9e12cb370fc2605e11404582ba54ef5ca2b2d98" @@ -3896,6 +3908,10 @@ window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" @@ -3904,10 +3920,6 @@ wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -3999,4 +4011,3 @@ yargs@~3.10.0: cliui "^2.1.0" decamelize "^1.0.0" window-size "0.1.0" - From 902f93d9371060021de7fa5a3010bbccd89139ef Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Fri, 10 Mar 2017 13:35:49 +0100 Subject: [PATCH 041/105] Update yarn lock --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index db51ddadf2..35360b8125 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1752,9 +1752,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.38.0: - version "0.38.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.38.0.tgz#3ae096d401c969cc8b5798253fb82381e2d0237a" +flow-bin@^0.40.0: + version "0.40.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.40.0.tgz#e10d60846d923124e47f548f16ba60fd8baff5a5" fn-name@^2.0.0: version "2.0.1" From 35e7732156d6878254b1da421440331245fb7bd6 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 10 Mar 2017 05:45:45 -0600 Subject: [PATCH 042/105] Fix watch command (#403) --- package.json | 3 ++- yarn.lock | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 231b143315..cb2d8571c8 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "rollup": "^0.41.0", "rollup-plugin-babel": "^2.6.1", "rollup-plugin-node-resolve": "^2.0.0", + "rollup-watch": "^3.2.2", "unicode-9.0.0": "~0.7.0" }, "bin": { @@ -56,7 +57,7 @@ "test-only": "ava", "test-ci": "nyc npm run test-only", "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'", - "watch": "npm run clean && cross-env BABEL_ENV=watch babel src --out-dir lib --watch" + "watch": "npm run clean && rollup -c --watch" }, "nyc": { "include": [ diff --git a/yarn.lock b/yarn.lock index 35360b8125..ac16c8d4f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3265,6 +3265,10 @@ require-precompiled@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/require-precompiled/-/require-precompiled-0.1.0.tgz#5a1b52eb70ebed43eb982e974c85ab59571e56fa" +require-relative@0.8.7: + version "0.8.7" + resolved "https://registry.yarnpkg.com/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de" + require-uncached@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" @@ -3343,6 +3347,12 @@ rollup-pluginutils@^1.5.0: estree-walker "^0.2.1" minimatch "^3.0.2" +rollup-watch@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-3.2.2.tgz#5e574232e9ef36da9177f46946d8080cb267354b" + dependencies: + require-relative "0.8.7" + rollup@^0.41.0: version "0.41.4" resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.4.tgz#a970580176329f9ead86854d7fd4c46de752aef8" From ca652bd934c39e892ee32419d1be2300ef1494d7 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 8 Mar 2017 09:34:22 -0600 Subject: [PATCH 043/105] Throw error if new.target is used outside of a function (#402) --- src/parser/expression.js | 8 +- .../es2015/uncategorised/336/expected.json | 95 ----------- .../es2015/uncategorised/336/options.json | 3 + .../es2015/uncategorised/394/actual.js | 1 + .../es2015/uncategorised/394/expected.json | 152 ++++++++++++++++++ 5 files changed, 163 insertions(+), 96 deletions(-) delete mode 100644 test/fixtures/es2015/uncategorised/336/expected.json create mode 100644 test/fixtures/es2015/uncategorised/336/options.json create mode 100644 test/fixtures/es2015/uncategorised/394/actual.js create mode 100644 test/fixtures/es2015/uncategorised/394/expected.json diff --git a/src/parser/expression.js b/src/parser/expression.js index f336e896b7..6c6777f380 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -662,7 +662,13 @@ pp.parseNew = function () { const meta = this.parseIdentifier(true); if (this.eat(tt.dot)) { - return this.parseMetaProperty(node, meta, "target"); + const metaProp = this.parseMetaProperty(node, meta, "target"); + + if (!this.state.inFunction) { + this.raise(metaProp.property.start, "new.target can only be used in functions"); + } + + return metaProp; } node.callee = this.parseNoCallExpr(); diff --git a/test/fixtures/es2015/uncategorised/336/expected.json b/test/fixtures/es2015/uncategorised/336/expected.json deleted file mode 100644 index 9822daf8c2..0000000000 --- a/test/fixtures/es2015/uncategorised/336/expected.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "expression": { - "type": "MetaProperty", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "meta": { - "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "name": "new" - }, - "property": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "target" - } - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/336/options.json b/test/fixtures/es2015/uncategorised/336/options.json new file mode 100644 index 0000000000..abb78cbdb2 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/336/options.json @@ -0,0 +1,3 @@ +{ + "throws": "new.target can only be used in functions (1:4)" +} diff --git a/test/fixtures/es2015/uncategorised/394/actual.js b/test/fixtures/es2015/uncategorised/394/actual.js new file mode 100644 index 0000000000..a83d19f0f8 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/394/actual.js @@ -0,0 +1 @@ +function foo() { new.target } diff --git a/test/fixtures/es2015/uncategorised/394/expected.json b/test/fixtures/es2015/uncategorised/394/expected.json new file mode 100644 index 0000000000..30b0e8ac73 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/394/expected.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "MetaProperty", + "start": 17, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "meta": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "target" + }, + "name": "target" + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file From c0a89f4c15e76a5aba7b975be98986b12571562a Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Fri, 10 Mar 2017 13:41:08 +0100 Subject: [PATCH 044/105] Upgrade flow to 0.41 --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cb2d8571c8..08106714de 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.20.0", - "flow-bin": "^0.40.0", + "flow-bin": "^0.41.0", "nyc": "^10.0.0", "rimraf": "^2.5.4", "rollup": "^0.41.0", diff --git a/yarn.lock b/yarn.lock index ac16c8d4f4..e902f0c7f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1752,9 +1752,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.40.0: - version "0.40.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.40.0.tgz#e10d60846d923124e47f548f16ba60fd8baff5a5" +flow-bin@^0.41.0: + version "0.41.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.41.0.tgz#8badac9a19da45004997e599bd316518db489b2e" fn-name@^2.0.0: version "2.0.1" From 4c88cfe7651148e61fdbc8b7b8d2f8e615db4178 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Fri, 10 Mar 2017 13:50:53 +0100 Subject: [PATCH 045/105] Disable failing tests (fixed in 7.0) --- .../async-functions/{no-method-asi => .no-method-asi}/actual.js | 0 .../{no-method-asi => .no-method-asi}/options.json | 0 .../{class-method-no-asi => .class-method-no-asi}/actual.js | 0 .../{class-method-no-asi => .class-method-no-asi}/options.json | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename test/fixtures/es2017/async-functions/{no-method-asi => .no-method-asi}/actual.js (100%) rename test/fixtures/es2017/async-functions/{no-method-asi => .no-method-asi}/options.json (100%) rename test/fixtures/experimental/async-generators/{class-method-no-asi => .class-method-no-asi}/actual.js (100%) rename test/fixtures/experimental/async-generators/{class-method-no-asi => .class-method-no-asi}/options.json (100%) diff --git a/test/fixtures/es2017/async-functions/no-method-asi/actual.js b/test/fixtures/es2017/async-functions/.no-method-asi/actual.js similarity index 100% rename from test/fixtures/es2017/async-functions/no-method-asi/actual.js rename to test/fixtures/es2017/async-functions/.no-method-asi/actual.js diff --git a/test/fixtures/es2017/async-functions/no-method-asi/options.json b/test/fixtures/es2017/async-functions/.no-method-asi/options.json similarity index 100% rename from test/fixtures/es2017/async-functions/no-method-asi/options.json rename to test/fixtures/es2017/async-functions/.no-method-asi/options.json diff --git a/test/fixtures/experimental/async-generators/class-method-no-asi/actual.js b/test/fixtures/experimental/async-generators/.class-method-no-asi/actual.js similarity index 100% rename from test/fixtures/experimental/async-generators/class-method-no-asi/actual.js rename to test/fixtures/experimental/async-generators/.class-method-no-asi/actual.js diff --git a/test/fixtures/experimental/async-generators/class-method-no-asi/options.json b/test/fixtures/experimental/async-generators/.class-method-no-asi/options.json similarity index 100% rename from test/fixtures/experimental/async-generators/class-method-no-asi/options.json rename to test/fixtures/experimental/async-generators/.class-method-no-asi/options.json From 4a813dc51a416eb216c717403d4629e6b21e26d0 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Fri, 10 Mar 2017 13:51:24 +0100 Subject: [PATCH 046/105] Revert "Disable failing tests (fixed in 7.0)" This reverts commit 4c88cfe7651148e61fdbc8b7b8d2f8e615db4178. --- .../async-functions/{.no-method-asi => no-method-asi}/actual.js | 0 .../{.no-method-asi => no-method-asi}/options.json | 0 .../{.class-method-no-asi => class-method-no-asi}/actual.js | 0 .../{.class-method-no-asi => class-method-no-asi}/options.json | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename test/fixtures/es2017/async-functions/{.no-method-asi => no-method-asi}/actual.js (100%) rename test/fixtures/es2017/async-functions/{.no-method-asi => no-method-asi}/options.json (100%) rename test/fixtures/experimental/async-generators/{.class-method-no-asi => class-method-no-asi}/actual.js (100%) rename test/fixtures/experimental/async-generators/{.class-method-no-asi => class-method-no-asi}/options.json (100%) diff --git a/test/fixtures/es2017/async-functions/.no-method-asi/actual.js b/test/fixtures/es2017/async-functions/no-method-asi/actual.js similarity index 100% rename from test/fixtures/es2017/async-functions/.no-method-asi/actual.js rename to test/fixtures/es2017/async-functions/no-method-asi/actual.js diff --git a/test/fixtures/es2017/async-functions/.no-method-asi/options.json b/test/fixtures/es2017/async-functions/no-method-asi/options.json similarity index 100% rename from test/fixtures/es2017/async-functions/.no-method-asi/options.json rename to test/fixtures/es2017/async-functions/no-method-asi/options.json diff --git a/test/fixtures/experimental/async-generators/.class-method-no-asi/actual.js b/test/fixtures/experimental/async-generators/class-method-no-asi/actual.js similarity index 100% rename from test/fixtures/experimental/async-generators/.class-method-no-asi/actual.js rename to test/fixtures/experimental/async-generators/class-method-no-asi/actual.js diff --git a/test/fixtures/experimental/async-generators/.class-method-no-asi/options.json b/test/fixtures/experimental/async-generators/class-method-no-asi/options.json similarity index 100% rename from test/fixtures/experimental/async-generators/.class-method-no-asi/options.json rename to test/fixtures/experimental/async-generators/class-method-no-asi/options.json From a5386433e1228fc7132544b29c7d4d06b342e585 Mon Sep 17 00:00:00 2001 From: James Browning Date: Tue, 14 Mar 2017 10:27:16 +1300 Subject: [PATCH 047/105] Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] --- ast/spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ast/spec.md b/ast/spec.md index f56ac4331d..2e0becb5b4 100644 --- a/ast/spec.md +++ b/ast/spec.md @@ -967,7 +967,7 @@ interface AssignmentProperty <: ObjectProperty { interface ObjectPattern <: Pattern { type: "ObjectPattern"; - properties: [ AssignmentProperty | RestPattern ]; + properties: [ AssignmentProperty | RestElement ]; } ``` From 873bf284bac01dba8506bb866ccfd22b7f5a19b6 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 13 Mar 2017 17:52:12 -0700 Subject: [PATCH 048/105] Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] --- ast/spec.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ast/spec.md b/ast/spec.md index 2e0becb5b4..c004ac452c 100644 --- a/ast/spec.md +++ b/ast/spec.md @@ -1022,10 +1022,9 @@ interface ClassBody <: Node { ## ClassMethod ```js -interface ClassMethod <: Node { +interface ClassMethod <: Function { type: "ClassMethod"; key: Expression; - value: FunctionExpression; kind: "constructor" | "method" | "get" | "set"; computed: boolean; static: boolean; From 9690daabd498aa15d4e59966147765e4a9c9ca18 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Wed, 15 Mar 2017 23:40:58 +0100 Subject: [PATCH 049/105] Update codecov to 2.0 (#412) --- package.json | 2 +- yarn.lock | 288 +++++++++++++++++++++++++-------------------------- 2 files changed, 143 insertions(+), 147 deletions(-) diff --git a/package.json b/package.json index 9be5d32a92..3b33c6c35f 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "babel-preset-es2015": "^6.14.0", "babel-preset-stage-0": "^6.5.0", "chalk": "^1.1.3", - "codecov": "^1.0.1", + "codecov": "^2.0.1", "cross-env": "^3.1.4", "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", diff --git a/yarn.lock b/yarn.lock index 8c75b196b9..8297bad4a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -57,8 +57,8 @@ ajv-keywords@^1.0.0: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" ajv@^4.7.0: - version "4.11.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.3.tgz#ce30bdb90d1254f762c75af915fb3a63e7183d22" + version "4.11.5" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.5.tgz#b6ee74657b993a01dce44b7944d56f485828d5bd" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" @@ -131,7 +131,7 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -argv@>=0.0.2: +argv@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab" @@ -179,14 +179,14 @@ asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -195,10 +195,6 @@ async@^1.4.0, async@^1.4.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" -async@~0.2.6: - version "0.2.10" - resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -304,12 +300,12 @@ aws4@^1.2.1: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" babel-cli@^6.14.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.23.0.tgz#52ff946a2b0f64645c35e7bd5eea267aa0948c0f" + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.24.0.tgz#a05ffd210dca0c288a26d5319c5ac8669a265ad0" dependencies: - babel-core "^6.23.0" + babel-core "^6.24.0" babel-polyfill "^6.23.0" - babel-register "^6.23.0" + babel-register "^6.24.0" babel-runtime "^6.22.0" commander "^2.8.1" convert-source-map "^1.1.0" @@ -332,15 +328,15 @@ babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@6, babel-core@^6.17.0, babel-core@^6.23.0: - version "6.23.1" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.23.1.tgz#c143cb621bb2f621710c220c5d579d15b8a442df" +babel-core@6, babel-core@^6.17.0, babel-core@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.0.tgz#8f36a0a77f5c155aed6f920b844d23ba56742a02" dependencies: babel-code-frame "^6.22.0" - babel-generator "^6.23.0" + babel-generator "^6.24.0" babel-helpers "^6.23.0" babel-messages "^6.23.0" - babel-register "^6.23.0" + babel-register "^6.24.0" babel-runtime "^6.22.0" babel-template "^6.23.0" babel-traverse "^6.23.1" @@ -366,9 +362,9 @@ babel-eslint@^7.0.0: babylon "^6.13.0" lodash.pickby "^4.6.0" -babel-generator@^6.1.0, babel-generator@^6.18.0, babel-generator@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.23.0.tgz#6b8edab956ef3116f79d8c84c5a3c05f32a74bc5" +babel-generator@^6.1.0, babel-generator@^6.18.0, babel-generator@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.0.tgz#eba270a8cc4ce6e09a61be43465d7c62c1f87c56" dependencies: babel-messages "^6.23.0" babel-runtime "^6.22.0" @@ -728,17 +724,17 @@ babel-plugin-transform-es2015-literals@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-modules-amd@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.22.0.tgz#bf69cd34889a41c33d90dfb740e0091ccff52f21" +babel-plugin-transform-es2015-modules-amd@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.0.tgz#a1911fb9b7ec7e05a43a63c5995007557bcf6a2e" dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.24.0" babel-runtime "^6.22.0" babel-template "^6.22.0" -babel-plugin-transform-es2015-modules-commonjs@^6.18.0, babel-plugin-transform-es2015-modules-commonjs@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.23.0.tgz#cba7aa6379fb7ec99250e6d46de2973aaffa7b92" +babel-plugin-transform-es2015-modules-commonjs@^6.18.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.0.tgz#e921aefb72c2cc26cb03d107626156413222134f" dependencies: babel-plugin-transform-strict-mode "^6.22.0" babel-runtime "^6.22.0" @@ -753,11 +749,11 @@ babel-plugin-transform-es2015-modules-systemjs@^6.22.0: babel-runtime "^6.22.0" babel-template "^6.23.0" -babel-plugin-transform-es2015-modules-umd@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.23.0.tgz#8d284ae2e19ed8fe21d2b1b26d6e7e0fcd94f0f1" +babel-plugin-transform-es2015-modules-umd@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.0.tgz#fd5fa63521cae8d273927c3958afd7c067733450" dependencies: - babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.0" babel-runtime "^6.22.0" babel-template "^6.23.0" @@ -878,8 +874,8 @@ babel-polyfill@^6.23.0: regenerator-runtime "^0.10.0" babel-preset-es2015@^6.14.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.22.0.tgz#af5a98ecb35eb8af764ad8a5a05eb36dc4386835" + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.0.tgz#c162d68b1932696e036cd3110dc1ccd303d2673a" dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-transform-es2015-arrow-functions "^6.22.0" @@ -892,10 +888,10 @@ babel-preset-es2015@^6.14.0: babel-plugin-transform-es2015-for-of "^6.22.0" babel-plugin-transform-es2015-function-name "^6.22.0" babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.22.0" - babel-plugin-transform-es2015-modules-commonjs "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.0" + babel-plugin-transform-es2015-modules-commonjs "^6.24.0" babel-plugin-transform-es2015-modules-systemjs "^6.22.0" - babel-plugin-transform-es2015-modules-umd "^6.22.0" + babel-plugin-transform-es2015-modules-umd "^6.24.0" babel-plugin-transform-es2015-object-super "^6.22.0" babel-plugin-transform-es2015-parameters "^6.22.0" babel-plugin-transform-es2015-shorthand-properties "^6.22.0" @@ -941,11 +937,11 @@ babel-preset-stage-3@^6.22.0: babel-plugin-transform-exponentiation-operator "^6.22.0" babel-plugin-transform-object-rest-spread "^6.22.0" -babel-register@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.23.0.tgz#c9aa3d4cca94b51da34826c4a0f9e08145d74ff3" +babel-register@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.0.tgz#5e89f8463ba9970356d02eb07dabe3308b080cfd" dependencies: - babel-core "^6.23.0" + babel-core "^6.24.0" babel-runtime "^6.22.0" core-js "^2.4.0" home-or-tmp "^2.0.0" @@ -994,8 +990,8 @@ babel-types@^6.15.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22 to-fast-properties "^1.0.1" babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" + version "6.16.1" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" balanced-match@^0.4.1: version "0.4.2" @@ -1018,8 +1014,8 @@ block-stream@*: inherits "~2.0.0" bluebird@^3.0.0: - version "3.4.7" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" + version "3.5.0" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" boom@2.x.x: version "2.10.1" @@ -1255,14 +1251,13 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" -codecov@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/codecov/-/codecov-1.0.1.tgz#97260ceac0e96b8eda8d562006558a53a139dffd" +codecov@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/codecov/-/codecov-2.0.1.tgz#bd645d13be28f41f78cb1885157c01d6001ac524" dependencies: - argv ">=0.0.2" - execSync "1.0.2" - request ">=2.42.0" - urlgrey ">=0.4.0" + argv "0.0.2" + request "2.79.0" + urlgrey "0.4.4" combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" @@ -1319,8 +1314,8 @@ convert-source-map@^1.1.0, convert-source-map@^1.2.0, convert-source-map@^1.3.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.4.0.tgz#e3dad195bf61bfe13a7a3c73e9876ec14a0268f3" convert-to-spaces@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/convert-to-spaces/-/convert-to-spaces-1.0.1.tgz#df97c15b6d061375cc4f3efe01bfc1f4d2a83ad6" + version "1.0.2" + resolved "https://registry.yarnpkg.com/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz#7e3e48bbe6d997b1417ddca2868204b4d3d85715" core-assert@^0.2.0: version "0.2.1" @@ -1344,23 +1339,25 @@ create-error-class@^3.0.1: capture-stack-trace "^1.0.0" cross-env@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-3.1.4.tgz#56e8bca96f17908a6eb1bc2012ca126f92842130" + version "3.2.4" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-3.2.4.tgz#9e0585f277864ed421ce756f81a980ff0d698aba" dependencies: - cross-spawn "^3.0.1" + cross-spawn "^5.1.0" + is-windows "^1.0.0" -cross-spawn@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982" +cross-spawn@^4, cross-spawn@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" dependencies: lru-cache "^4.0.1" which "^1.2.9" -cross-spawn@^4, cross-spawn@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" +cross-spawn@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" dependencies: lru-cache "^4.0.1" + shebang-command "^1.2.0" which "^1.2.9" cryptiles@2.x.x: @@ -1396,8 +1393,8 @@ debug-log@^1.0.1: resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" debug@^2.1.1, debug@^2.2.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.1.tgz#79855090ba2c4e3115cc7d8769491d58f0491351" + version "2.6.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" dependencies: ms "0.7.2" @@ -1502,14 +1499,14 @@ equal-length@^1.0.0: resolved "https://registry.yarnpkg.com/equal-length/-/equal-length-1.0.1.tgz#21ca112d48ab24b4e1e7ffc0e5339d31fdfc274c" error-ex@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: is-arrayish "^0.2.1" es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7: - version "0.10.12" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047" + version "0.10.13" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.13.tgz#a390ab717bde1ce3b4cbaeabe23ca8fbddcb06f6" dependencies: es6-iterator "2" es6-symbol "~3.1" @@ -1577,14 +1574,14 @@ eslint-config-babel@^6.0.0: resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-6.0.0.tgz#66feedf6ce6e04abe585cec1a65b5bcc96bed50a" eslint-plugin-flowtype@^2.20.0: - version "2.30.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.0.tgz#3054a265f9c8afe3046c3d41b72d32a736f9b4ae" + version "2.30.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.3.tgz#57835d2c0ed388da7a2725803ec32af2f437c301" dependencies: lodash "^4.15.0" eslint@^3.7.1: - version "3.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.16.0.tgz#4a468ab93618a9eb6e3f1499038b38851f828630" + version "3.17.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.17.1.tgz#b80ae12d9c406d858406fccda627afce33ea10ea" dependencies: babel-code-frame "^6.16.0" chalk "^1.1.3" @@ -1642,8 +1639,8 @@ esprima@^3.1.1: resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" espurify@^1.6.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.6.1.tgz#a618c3b320071a4e9e7136c5d78717cdd07020da" + version "1.7.0" + resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.7.0.tgz#1c5cf6cbccc32e6f639380bd4f991fab9ba9d226" dependencies: core-js "^2.0.0" @@ -1677,12 +1674,6 @@ event-emitter@~0.3.4: d "~0.1.1" es5-ext "~0.10.7" -execSync@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/execSync/-/execSync-1.0.2.tgz#1f42eda582225180053224ecdd3fd1960fdb3139" - dependencies: - temp "~0.5.1" - execa@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" @@ -1805,15 +1796,15 @@ fn-name@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" -for-in@^0.1.5: - version "0.1.6" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" for-own@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.4.tgz#0149b41a39088c7515f51ebe1c1386d45f935072" + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" dependencies: - for-in "^0.1.5" + for-in "^1.0.1" foreground-child@^1.3.3, foreground-child@^1.5.3: version "1.5.6" @@ -1858,8 +1849,8 @@ fstream-ignore@~1.0.5: minimatch "^3.0.0" fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.10.tgz#604e8a92fe26ffd9f6fae30399d4984e1ab22822" + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -1989,10 +1980,6 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -graceful-fs@~1: - version "1.2.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364" - "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" @@ -2158,8 +2145,8 @@ is-binary-path@^1.0.0: binary-extensions "^1.0.0" is-buffer@^1.0.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" is-builtin-module@^1.0.0: version "1.0.0" @@ -2222,8 +2209,8 @@ is-glob@^2.0.0, is-glob@^2.0.1: is-extglob "^1.0.0" is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: - version "2.15.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" + version "2.16.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" dependencies: generate-function "^2.0.0" generate-object-property "^1.1.0" @@ -2316,6 +2303,10 @@ is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" +is-windows@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.0.tgz#c61d61020c3ebe99261b781bd3d1622395f547f8" + isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2439,8 +2430,8 @@ js-tokens@^3.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" js-yaml@^3.5.1: - version "3.8.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.1.tgz#782ba50200be7b9e5a8537001b7804db3ad02628" + version "3.8.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.2.tgz#02d3e2c0f6beab20248d412c352203827d786721" dependencies: argparse "^1.0.7" esprima "^3.1.1" @@ -2484,9 +2475,10 @@ jsonpointer@^4.0.0: resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" jsprim@^1.2.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.3.1.tgz#2a7256f70412a29ee3670aaca625994c4dcff252" + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" dependencies: + assert-plus "1.0.0" extsprintf "1.0.2" json-schema "0.2.3" verror "1.3.6" @@ -2715,10 +2707,14 @@ ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" -ms@0.7.2, ms@^0.7.1: +ms@0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" +ms@^0.7.1: + version "0.7.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" + multimatch@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" @@ -2765,8 +2761,8 @@ nopt@~3.0.6: abbrev "1" normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: - version "2.3.5" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df" + version "2.3.6" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.6.tgz#498fa420c96401f787402ba21e600def9f981fff" dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -3121,8 +3117,8 @@ punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" qs@~6.3.0: - version "6.3.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.1.tgz#918c0b3bcd36679772baf135b1acb4c1651ed79d" + version "6.3.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" randomatic@^1.1.3: version "1.1.6" @@ -3178,8 +3174,8 @@ read-pkg@^2.0.0: path-type "^2.0.0" readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" + version "2.2.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.5.tgz#a0b187304e05bab01a4ce2b4cc9c607d5aa1d606" dependencies: buffer-shims "^1.0.0" core-util-is "~1.0.0" @@ -3298,7 +3294,7 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@>=2.42.0, request@^2.79.0: +request@2.79.0, request@^2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" dependencies: @@ -3365,8 +3361,10 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" resolve@^1.1.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" + version "1.3.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235" + dependencies: + path-parse "^1.0.5" restore-cursor@^1.0.1: version "1.0.1" @@ -3389,17 +3387,11 @@ right-align@^0.1.1: align-text "^0.1.1" rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@^2.5.4: - version "2.6.0" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.0.tgz#89b8a0fe432b9ff9ec9a925a00b6cdb3a91bbada" + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: glob "^7.0.5" -rimraf@~2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.1.4.tgz#5a6eb62eeda068f51ede50f29b3e5cd22f3d9bb2" - optionalDependencies: - graceful-fs "~1" - rimraf@~2.5.1, rimraf@~2.5.4: version "2.5.4" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" @@ -3437,8 +3429,8 @@ rollup-watch@^3.2.2: require-relative "0.8.7" rollup@^0.41.0: - version "0.41.4" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.4.tgz#a970580176329f9ead86854d7fd4c46de752aef8" + version "0.41.5" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.5.tgz#cdfaade5cd1c2c7314351566a50ef74df6e66e3d" dependencies: source-map-support "^0.4.0" @@ -3470,9 +3462,19 @@ set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + shelljs@^0.7.5: - version "0.7.6" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad" + version "0.7.7" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -3504,17 +3506,17 @@ sntp@1.x.x: dependencies: hoek "2.x.x" -sort-keys@^1.1.1: +sort-keys@^1.1.1, sort-keys@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" dependencies: is-plain-obj "^1.0.0" source-map-support@^0.4.0, source-map-support@^0.4.2: - version "0.4.11" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.11.tgz#647f939978b38535909530885303daf23279f322" + version "0.4.12" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.12.tgz#f47d02bf01efaf0c160d3a37d038401b92b1867e" dependencies: - source-map "^0.5.3" + source-map "^0.5.6" source-map@^0.4.4: version "0.4.4" @@ -3522,7 +3524,7 @@ source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.3, source-map@~0.5.1: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -3556,8 +3558,8 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" sshpk@^1.7.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.2.tgz#d5a804ce22695515638e798dbe23273de070a5fa" + version "1.11.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.11.0.tgz#2d8d5ebb4a6fab28ffba37fa62a90f4a3ea59d77" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -3683,12 +3685,6 @@ tar@~2.2.1: fstream "^1.0.2" inherits "2" -temp@~0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/temp/-/temp-0.5.1.tgz#77ab19c79aa7b593cbe4fac2441768cad987b8df" - dependencies: - rimraf "~2.1.4" - test-exclude@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-3.3.0.tgz#7a17ca1239988c98367b0621456dbb7d4bc38977" @@ -3782,10 +3778,9 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" uglify-js@^2.6: - version "2.7.5" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8" + version "2.8.12" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.12.tgz#8a50f5d482243650b7108f6080aa3a6afe2a6c55" dependencies: - async "~0.2.6" source-map "~0.5.1" uglify-to-browserify "~1.0.0" yargs "~3.10.0" @@ -3837,7 +3832,7 @@ url-parse-lax@^1.0.0: dependencies: prepend-http "^1.0.1" -urlgrey@>=0.4.0: +urlgrey@0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-0.4.4.tgz#892fe95960805e85519f1cd4389f2cb4cbb7652f" @@ -3950,9 +3945,10 @@ write-json-file@^2.0.0: write-file-atomic "^1.1.2" write-pkg@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-2.0.0.tgz#93b922ee9a429f9bd74cdc69e549733c9e468156" + version "2.1.0" + resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-2.1.0.tgz#353aa44c39c48c21440f5c08ce6abd46141c9c08" dependencies: + sort-keys "^1.1.2" write-json-file "^2.0.0" write@^0.2.1: @@ -3976,8 +3972,8 @@ y18n@^3.2.1: resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" yallist@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.0.0.tgz#306c543835f09ee1a4cb23b7bce9ab341c91cdd4" + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" yargs-parser@^4.0.2, yargs-parser@^4.2.0: version "4.2.1" From 82b7872cb8f8bb5fa86962c39ee7b407dcaf09de Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 19 Mar 2017 21:58:20 +0100 Subject: [PATCH 050/105] Optimize travis builds (#419) * Optimize travis builds * Use yarn * Fix babel tests to correctly fail * Check against 7.0 branch of babel --- .travis.yml | 43 +++++----- Makefile | 7 +- package.json | 23 ++---- yarn.lock | 219 ++++++++++++++++++++++++++------------------------- 4 files changed, 147 insertions(+), 145 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88a08570a5..eb22eaf9c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,34 +5,39 @@ node_js: - "6" - "7" +env: + - JOB=test + before_script: - - 'if [ -n "${BABEL-}" ]; then make bootstrap-babel ; fi' - - 'if [ -n "${FLOWTESTS-}" ]; then make bootstrap-flow ; fi' - - 'BABEL_ENV=test npm run build' + - 'if [ "$JOB" = "babel-test" ]; then make bootstrap-babel ; fi' + - 'if [ "$JOB" = "flow-test" ]; then make bootstrap-flow ; fi' + - 'if [ "$JOB" = "test" ]; then yarn run build; fi' script: - - 'if [ -n "${LINT-}" ]; then npm run lint ; fi' - - 'if [ -n "${FLOW-}" ]; then npm run flow ; fi' - - 'if [ -n "${FLOWTESTS-}" ]; then make test-flow ; fi' - - 'if [ -n "${BABEL-}" ]; then make test-babel ; fi' - - 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ] && [ -z "${BABEL-}" ] && [ -z "${FLOWTESTS-}" ]; then npm run test-ci ; fi' + - 'if [ "$JOB" = "test" ]; then yarn test-only; fi' + - 'if [ "$JOB" = "lint" ]; then yarn run lint && yarn run flow; fi' + - 'if [ "$JOB" = "flow-test" ]; then make test-flow; fi' + - 'if [ "$JOB" = "babel-test" ]; then make test-babel; fi' + - 'if [ "$JOB" = "test-coverage" ]; then yarn run test-coverage; fi' matrix: fast_finish: true include: - - node_js: "node" - env: LINT=true - - node_js: "node" - env: FLOW=true - - node_js: "node" - env: BABEL=true - - node_js: "node" - env: FLOWTESTS=true + - node_js: "lts/*" + env: JOB=test-coverage + - node_js: "lts/*" + env: JOB=lint + - node_js: "lts/*" + env: JOB=babel-test + - node_js: "lts/*" + env: JOB=flow-test allow_failures: - - node_js: "node" - env: FLOWTESTS=true + - node_js: "lts/*" + env: JOB=flow-test -after_success: 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ] && [ -z "${FLOWTESTS-}" ]; then npm run coverage ; fi' +after_success: + - 'if [ "$JOB" = "babel-test" ]; then bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json -F babel ; fi' + - 'if [ "$JOB" = "test-coverage" ]; then bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json -F babylon ; fi' notifications: slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK diff --git a/Makefile b/Makefile index 22e088f90a..82a89ee84b 100644 --- a/Makefile +++ b/Makefile @@ -8,19 +8,18 @@ clean: ; rm -rf ./build bootstrap-babel: clean mkdir ./build - git clone --depth=1 --branch=master https://github.com/babel/babel.git ./build/babel + git clone --depth=1 --branch=7.0 https://github.com/babel/babel.git ./build/babel cd ./build/babel; \ make bootstrap find ./build/babel/packages -type d -name 'babylon' -prune -exec rm -rf '{}' \; -exec ln -s '../../../../../' '{}' \; test-babel: - BABEL_ENV=test npm run build + BABEL_ENV=test yarn run build # in case babel ever switches to nyc: filter its config out of package.json cd ./build/babel; \ jq "del(.nyc)" package.json > package.nonyc.json; \ mv -f package.nonyc.json package.json; \ - ../../node_modules/.bin/nyc --no-instrument --no-source-map --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts; \ - mv .nyc_output ../../.nyc_output + ../../node_modules/.bin/nyc --no-instrument --no-source-map --reporter=json --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts; \ bootstrap-flow: clean mkdir ./build diff --git a/package.json b/package.json index 3b33c6c35f..50602a7345 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "babel-preset-es2015": "^6.14.0", "babel-preset-stage-0": "^6.5.0", "chalk": "^1.1.3", - "codecov": "^2.0.1", "cross-env": "^3.1.4", "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", @@ -49,18 +48,17 @@ "babylon": "./bin/babylon.js" }, "scripts": { - "build": "npm run clean && rollup -c", - "coverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json", - "lint": "eslint src bin", + "build": "yarn run clean && rollup -c", + "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'", "clean": "rimraf lib", "flow": "flow", - "prepublish": "cross-env BABEL_ENV=production npm run build", - "preversion": "npm run test && npm run changelog", - "test": "npm run lint && npm run flow && npm run build -- -m && npm run test-only", + "lint": "eslint src bin", + "prepublish": "cross-env BABEL_ENV=production yarn run build", + "preversion": "yarn run test && npm run changelog", + "test": "yarn run lint && yarn run flow && yarn run build -- -m && yarn run test-only", "test-only": "ava", - "test-ci": "nyc npm run test-only", - "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'", - "watch": "npm run clean && rollup -c --watch" + "test-coverage": "cross-env BABEL_ENV=test yarn run build && nyc --reporter=json --reporter=text yarn run test-only", + "watch": "yarn run clean && rollup -c --watch" }, "nyc": { "include": [ @@ -78,10 +76,5 @@ "src/**/*.js", "bin/**/*.js" ] - }, - "greenkeeper": { - "ignore": [ - "cross-env" - ] } } diff --git a/yarn.lock b/yarn.lock index 8297bad4a5..c6ceaa3310 100644 --- a/yarn.lock +++ b/yarn.lock @@ -56,7 +56,7 @@ ajv-keywords@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" -ajv@^4.7.0: +ajv@^4.7.0, ajv@^4.9.1: version "4.11.5" resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.5.tgz#b6ee74657b993a01dce44b7944d56f485828d5bd" dependencies: @@ -131,10 +131,6 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -argv@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab" - arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" @@ -1124,9 +1120,9 @@ capture-stack-trace@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" center-align@^0.1.1: version "0.1.3" @@ -1251,21 +1247,13 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" -codecov@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/codecov/-/codecov-2.0.1.tgz#bd645d13be28f41f78cb1885157c01d6001ac524" - dependencies: - argv "0.0.2" - request "2.79.0" - urlgrey "0.4.4" - combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" dependencies: delayed-stream "~1.0.0" -commander@^2.8.1, commander@^2.9.0: +commander@^2.8.1: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: @@ -1283,7 +1271,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.4.6: +concat-stream@^1.5.2: version "1.6.0" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: @@ -1372,11 +1360,11 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" -d@^0.1.1, d@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" dependencies: - es5-ext "~0.10.2" + es5-ext "^0.10.9" dashdash@^1.12.0: version "1.14.1" @@ -1456,9 +1444,9 @@ diff@^3.0.0, diff@^3.0.1: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" -doctrine@^1.2.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" +doctrine@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" dependencies: esutils "^2.0.2" isarray "^1.0.0" @@ -1504,57 +1492,57 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" -es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7: - version "0.10.13" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.13.tgz#a390ab717bde1ce3b4cbaeabe23ca8fbddcb06f6" +es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.14" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.14.tgz#625bc9ab9cac0f6fb9dc271525823d1800b3d360" dependencies: es6-iterator "2" es6-symbol "~3.1" -es6-iterator@2: - version "2.0.0" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac" +es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" dependencies: - d "^0.1.1" - es5-ext "^0.10.7" - es6-symbol "3" + d "1" + es5-ext "^0.10.14" + es6-symbol "^3.1" es6-map@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.4.tgz#a34b147be224773a4d7da8072794cefa3632b897" + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - es6-iterator "2" - es6-set "~0.1.3" - es6-symbol "~3.1.0" - event-emitter "~0.3.4" + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" -es6-set@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8" +es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - es6-iterator "2" - es6-symbol "3" - event-emitter "~0.3.4" + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" -es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" +es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" dependencies: - d "~0.1.1" - es5-ext "~0.10.11" + d "1" + es5-ext "~0.10.14" es6-weak-map@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81" + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" dependencies: - d "^0.1.1" - es5-ext "^0.10.8" - es6-iterator "2" - es6-symbol "3" + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.4, escape-string-regexp@^1.0.5: version "1.0.5" @@ -1580,16 +1568,17 @@ eslint-plugin-flowtype@^2.20.0: lodash "^4.15.0" eslint@^3.7.1: - version "3.17.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.17.1.tgz#b80ae12d9c406d858406fccda627afce33ea10ea" + version "3.18.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.18.0.tgz#647e985c4ae71502d20ac62c109f66d5104c8a4b" dependencies: babel-code-frame "^6.16.0" chalk "^1.1.3" - concat-stream "^1.4.6" + concat-stream "^1.5.2" debug "^2.1.1" - doctrine "^1.2.2" + doctrine "^2.0.0" escope "^3.6.0" espree "^3.4.0" + esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" @@ -1644,6 +1633,12 @@ espurify@^1.6.0: dependencies: core-js "^2.0.0" +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + esrecurse@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" @@ -1667,12 +1662,12 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -event-emitter@~0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5" +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" dependencies: - d "~0.1.1" - es5-ext "~0.10.7" + d "1" + es5-ext "~0.10.14" execa@^0.5.0: version "0.5.1" @@ -1994,14 +1989,16 @@ handlebars@^4.0.3: optionalDependencies: uglify-js "^2.6" -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" + ajv "^4.9.1" + har-schema "^1.0.5" has-ansi@^2.0.0: version "2.0.0" @@ -2050,8 +2047,8 @@ home-or-tmp@^2.0.0: os-tmpdir "^1.0.1" hosted-git-info@^2.1.4: - version "2.2.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.2.0.tgz#7a0d097863d886c0fabbdcd37bf1758d8becf8a5" + version "2.3.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.3.1.tgz#ac439421605f0beb0ea1349de7d8bb28e50be1dd" http-signature@~1.1.0: version "1.1.1" @@ -2066,8 +2063,8 @@ ignore-by-default@^1.0.0: resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" ignore@^3.2.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.4.tgz#4055e03596729a8fabe45a43c100ad5ed815c4e8" + version "3.2.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.6.tgz#26e8da0644be0bb4cb39516f6c79f0e0f4ffe48c" imurmurhash@^0.1.4: version "0.1.4" @@ -2208,7 +2205,7 @@ is-glob@^2.0.0, is-glob@^2.0.1: dependencies: is-extglob "^1.0.0" -is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: +is-my-json-valid@^2.10.0: version "2.16.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" dependencies: @@ -3013,6 +3010,10 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -3116,9 +3117,9 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -qs@~6.3.0: - version "6.3.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" randomatic@^1.1.3: version "1.1.6" @@ -3174,8 +3175,8 @@ read-pkg@^2.0.0: path-type "^2.0.0" readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2: - version "2.2.5" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.5.tgz#a0b187304e05bab01a4ce2b4cc9c607d5aa1d606" + version "2.2.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.6.tgz#8b43aed76e71483938d12a8d46c6cf1a00b1f816" dependencies: buffer-shims "^1.0.0" core-util-is "~1.0.0" @@ -3294,18 +3295,18 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@2.79.0, request@^2.79.0: - version "2.79.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" +request@^2.79.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: aws-sign2 "~0.6.0" aws4 "^1.2.1" - caseless "~0.11.0" + caseless "~0.12.0" combined-stream "~1.0.5" extend "~3.0.0" forever-agent "~0.6.1" form-data "~2.1.1" - har-validator "~2.0.6" + har-validator "~4.2.1" hawk "~3.1.3" http-signature "~1.1.0" is-typedarray "~1.0.0" @@ -3313,10 +3314,12 @@ request@2.79.0, request@^2.79.0: json-stringify-safe "~5.0.1" mime-types "~2.1.7" oauth-sign "~0.8.1" - qs "~6.3.0" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" stringstream "~0.0.4" tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" + tunnel-agent "^0.6.0" uuid "^3.0.0" require-directory@^2.1.1: @@ -3429,8 +3432,8 @@ rollup-watch@^3.2.2: require-relative "0.8.7" rollup@^0.41.0: - version "0.41.5" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.5.tgz#cdfaade5cd1c2c7314351566a50ef74df6e66e3d" + version "0.41.6" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" dependencies: source-map-support "^0.4.0" @@ -3444,6 +3447,10 @@ rx-lite@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" +safe-buffer@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + semver-diff@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" @@ -3513,8 +3520,8 @@ sort-keys@^1.1.1, sort-keys@^1.1.2: is-plain-obj "^1.0.0" source-map-support@^0.4.0, source-map-support@^0.4.2: - version "0.4.12" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.12.tgz#f47d02bf01efaf0c160d3a37d038401b92b1867e" + version "0.4.14" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.14.tgz#9d4463772598b86271b4f523f6c1f4e02a7d6aef" dependencies: source-map "^0.5.6" @@ -3759,9 +3766,11 @@ tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" @@ -3778,8 +3787,8 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" uglify-js@^2.6: - version "2.8.12" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.12.tgz#8a50f5d482243650b7108f6080aa3a6afe2a6c55" + version "2.8.13" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.13.tgz#d0cdf02f3c661484fac601b7e723207b735a374c" dependencies: source-map "~0.5.1" uglify-to-browserify "~1.0.0" @@ -3832,10 +3841,6 @@ url-parse-lax@^1.0.0: dependencies: prepend-http "^1.0.1" -urlgrey@0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-0.4.4.tgz#892fe95960805e85519f1cd4389f2cb4cbb7652f" - user-home@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" From 0545173f664b76c24a2e7bcc4aac6f80b533d680 Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 19 Mar 2017 14:03:11 -0700 Subject: [PATCH 051/105] Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) * Test runner: Detect extra property in 'actual' but not in 'expected'. Also update all expected.json where this would result in errors. * Include rmExpected.js script in case it is needed again --- scripts/rmExpected.js | 24 + .../block-trailing-comment/expected.json | 3 +- .../comment-within-condition/expected.json | 3 +- .../expected.json | 6 +- .../basic/shebang-import/expected.json | 14 +- .../basic/shebang-object/expected.json | 21 +- .../surrounding-call-comments/expected.json | 7 +- .../expected.json | 4 +- .../surrounding-return-comments/expected.json | 4 +- .../surrounding-throw-comments/expected.json | 4 +- .../expected.json | 7 +- .../expected.json | 13 +- .../switch-fallthrough-comment/expected.json | 6 +- .../expected.json | 10 +- .../expected.json | 43 +- .../switch-no-default-comment/expected.json | 3 +- .../filename-specified/expected.json | 3 +- .../categorized/not-directive/expected.json | 2 +- .../startline-specified/expected.json | 291 +------- .../core/regression/2591/expected.json | 7 +- .../core/uncategorised/1/expected.json | 3 +- .../core/uncategorised/10/expected.json | 3 +- .../core/uncategorised/102/expected.json | 3 +- .../core/uncategorised/103/expected.json | 3 +- .../core/uncategorised/104/expected.json | 3 +- .../core/uncategorised/105/expected.json | 3 +- .../core/uncategorised/106/expected.json | 3 +- .../core/uncategorised/107/expected.json | 3 +- .../core/uncategorised/108/expected.json | 3 +- .../core/uncategorised/109/expected.json | 6 +- .../core/uncategorised/11/expected.json | 3 +- .../core/uncategorised/110/expected.json | 6 +- .../core/uncategorised/111/expected.json | 6 +- .../core/uncategorised/112/expected.json | 6 +- .../core/uncategorised/113/expected.json | 9 +- .../core/uncategorised/114/expected.json | 9 +- .../core/uncategorised/115/expected.json | 9 +- .../core/uncategorised/116/expected.json | 9 +- .../core/uncategorised/117/expected.json | 12 +- .../core/uncategorised/118/expected.json | 6 +- .../core/uncategorised/119/expected.json | 9 +- .../core/uncategorised/12/expected.json | 3 +- .../core/uncategorised/120/expected.json | 12 +- .../core/uncategorised/121/expected.json | 15 +- .../core/uncategorised/122/expected.json | 12 +- .../core/uncategorised/123/expected.json | 9 +- .../core/uncategorised/124/expected.json | 6 +- .../core/uncategorised/125/expected.json | 6 +- .../core/uncategorised/126/expected.json | 9 +- .../core/uncategorised/127/expected.json | 12 +- .../core/uncategorised/128/expected.json | 9 +- .../core/uncategorised/129/expected.json | 9 +- .../core/uncategorised/13/expected.json | 3 +- .../core/uncategorised/130/expected.json | 9 +- .../core/uncategorised/131/expected.json | 9 +- .../core/uncategorised/132/expected.json | 6 +- .../core/uncategorised/133/expected.json | 6 +- .../core/uncategorised/134/expected.json | 6 +- .../core/uncategorised/135/expected.json | 6 +- .../core/uncategorised/136/expected.json | 6 +- .../core/uncategorised/137/expected.json | 6 +- .../core/uncategorised/138/expected.json | 9 +- .../core/uncategorised/139/expected.json | 9 +- .../core/uncategorised/14/expected.json | 6 +- .../core/uncategorised/140/expected.json | 9 +- .../core/uncategorised/141/expected.json | 9 +- .../core/uncategorised/142/expected.json | 9 +- .../core/uncategorised/143/expected.json | 9 +- .../core/uncategorised/144/expected.json | 9 +- .../core/uncategorised/145/expected.json | 9 +- .../core/uncategorised/146/expected.json | 9 +- .../core/uncategorised/147/expected.json | 9 +- .../core/uncategorised/148/expected.json | 9 +- .../core/uncategorised/149/expected.json | 9 +- .../core/uncategorised/15/expected.json | 6 +- .../core/uncategorised/150/expected.json | 9 +- .../core/uncategorised/151/expected.json | 9 +- .../core/uncategorised/152/expected.json | 9 +- .../core/uncategorised/153/expected.json | 9 +- .../core/uncategorised/154/expected.json | 9 +- .../core/uncategorised/155/expected.json | 9 +- .../core/uncategorised/156/expected.json | 9 +- .../core/uncategorised/157/expected.json | 9 +- .../core/uncategorised/158/expected.json | 9 +- .../core/uncategorised/159/expected.json | 9 +- .../core/uncategorised/16/expected.json | 6 +- .../core/uncategorised/160/expected.json | 9 +- .../core/uncategorised/161/expected.json | 9 +- .../core/uncategorised/162/expected.json | 9 +- .../core/uncategorised/163/expected.json | 9 +- .../core/uncategorised/164/expected.json | 9 +- .../core/uncategorised/165/expected.json | 12 +- .../core/uncategorised/166/expected.json | 9 +- .../core/uncategorised/167/expected.json | 9 +- .../core/uncategorised/168/expected.json | 9 +- .../core/uncategorised/169/expected.json | 9 +- .../core/uncategorised/17/expected.json | 6 +- .../core/uncategorised/170/expected.json | 9 +- .../core/uncategorised/171/expected.json | 9 +- .../core/uncategorised/172/expected.json | 9 +- .../core/uncategorised/173/expected.json | 12 +- .../core/uncategorised/174/expected.json | 12 +- .../core/uncategorised/175/expected.json | 12 +- .../core/uncategorised/176/expected.json | 12 +- .../core/uncategorised/177/expected.json | 12 +- .../core/uncategorised/178/expected.json | 12 +- .../core/uncategorised/179/expected.json | 12 +- .../core/uncategorised/18/expected.json | 6 +- .../core/uncategorised/180/expected.json | 12 +- .../core/uncategorised/181/expected.json | 12 +- .../core/uncategorised/182/expected.json | 12 +- .../core/uncategorised/183/expected.json | 12 +- .../core/uncategorised/184/expected.json | 12 +- .../core/uncategorised/185/expected.json | 12 +- .../core/uncategorised/186/expected.json | 12 +- .../core/uncategorised/187/expected.json | 12 +- .../core/uncategorised/188/expected.json | 12 +- .../core/uncategorised/189/expected.json | 12 +- .../core/uncategorised/19/expected.json | 6 +- .../core/uncategorised/190/expected.json | 12 +- .../core/uncategorised/191/expected.json | 9 +- .../core/uncategorised/192/expected.json | 9 +- .../core/uncategorised/193/expected.json | 12 +- .../core/uncategorised/194/expected.json | 12 +- .../core/uncategorised/195/expected.json | 12 +- .../core/uncategorised/196/expected.json | 12 +- .../core/uncategorised/197/expected.json | 3 +- .../core/uncategorised/198/expected.json | 6 +- .../core/uncategorised/199/expected.json | 3 +- .../core/uncategorised/2/expected.json | 3 +- .../core/uncategorised/20/expected.json | 6 +- .../core/uncategorised/200/expected.json | 3 +- .../core/uncategorised/201/expected.json | 3 +- .../core/uncategorised/202/expected.json | 3 +- .../core/uncategorised/203/expected.json | 3 +- .../core/uncategorised/204/expected.json | 3 +- .../core/uncategorised/205/expected.json | 3 +- .../core/uncategorised/206/expected.json | 3 +- .../core/uncategorised/207/expected.json | 3 +- .../core/uncategorised/208/expected.json | 3 +- .../core/uncategorised/209/expected.json | 3 +- .../core/uncategorised/21/expected.json | 6 +- .../core/uncategorised/210/expected.json | 3 +- .../core/uncategorised/211/expected.json | 3 +- .../core/uncategorised/212/expected.json | 3 +- .../core/uncategorised/213/expected.json | 9 +- .../core/uncategorised/214/expected.json | 12 +- .../core/uncategorised/215/expected.json | 6 +- .../core/uncategorised/216/expected.json | 6 +- .../core/uncategorised/217/expected.json | 9 +- .../core/uncategorised/218/expected.json | 3 +- .../core/uncategorised/219/expected.json | 6 +- .../core/uncategorised/22/expected.json | 6 +- .../core/uncategorised/220/expected.json | 9 +- .../core/uncategorised/221/expected.json | 12 +- .../core/uncategorised/222/expected.json | 15 +- .../core/uncategorised/223/expected.json | 3 +- .../core/uncategorised/224/expected.json | 6 +- .../core/uncategorised/225/expected.json | 9 +- .../core/uncategorised/226/expected.json | 6 +- .../core/uncategorised/227/expected.json | 6 +- .../core/uncategorised/228/expected.json | 9 +- .../core/uncategorised/229/expected.json | 7 +- .../core/uncategorised/23/expected.json | 6 +- .../core/uncategorised/230/expected.json | 6 +- .../core/uncategorised/231/expected.json | 12 +- .../core/uncategorised/232/expected.json | 3 +- .../core/uncategorised/233/expected.json | 3 +- .../core/uncategorised/234/expected.json | 9 +- .../core/uncategorised/236/expected.json | 3 +- .../core/uncategorised/237/expected.json | 9 +- .../core/uncategorised/238/expected.json | 3 +- .../core/uncategorised/239/expected.json | 6 +- .../core/uncategorised/24/expected.json | 6 +- .../core/uncategorised/240/expected.json | 3 +- .../core/uncategorised/241/expected.json | 3 +- .../core/uncategorised/242/expected.json | 6 +- .../core/uncategorised/243/expected.json | 6 +- .../core/uncategorised/244/expected.json | 9 +- .../core/uncategorised/245/expected.json | 15 +- .../core/uncategorised/246/expected.json | 16 +- .../core/uncategorised/247/expected.json | 16 +- .../core/uncategorised/25/expected.json | 6 +- .../core/uncategorised/252/expected.json | 6 +- .../core/uncategorised/253/expected.json | 6 +- .../core/uncategorised/255/expected.json | 6 +- .../core/uncategorised/256/expected.json | 6 +- .../core/uncategorised/257/expected.json | 180 ++++- .../core/uncategorised/258/expected.json | 212 +++++- .../core/uncategorised/259/expected.json | 4 +- .../core/uncategorised/26/expected.json | 6 +- .../core/uncategorised/260/expected.json | 4 +- .../core/uncategorised/261/expected.json | 7 +- .../core/uncategorised/262/expected.json | 10 +- .../core/uncategorised/263/expected.json | 168 ++++- .../core/uncategorised/264/expected.json | 168 ++++- .../core/uncategorised/265/expected.json | 12 +- .../core/uncategorised/266/expected.json | 12 +- .../core/uncategorised/267/expected.json | 15 +- .../core/uncategorised/268/expected.json | 6 +- .../core/uncategorised/269/expected.json | 6 +- .../core/uncategorised/27/expected.json | 3 +- .../core/uncategorised/270/expected.json | 6 +- .../core/uncategorised/271/expected.json | 9 +- .../core/uncategorised/272/expected.json | 6 +- .../core/uncategorised/273/expected.json | 6 +- .../core/uncategorised/274/expected.json | 9 +- .../core/uncategorised/275/expected.json | 3 +- .../core/uncategorised/276/expected.json | 12 +- .../core/uncategorised/277/expected.json | 12 +- .../core/uncategorised/278/expected.json | 12 +- .../core/uncategorised/279/expected.json | 18 +- .../core/uncategorised/28/expected.json | 9 +- .../core/uncategorised/280/expected.json | 15 +- .../core/uncategorised/281/expected.json | 21 +- .../core/uncategorised/282/expected.json | 30 +- .../core/uncategorised/283/expected.json | 3 +- .../core/uncategorised/284/expected.json | 13 +- .../core/uncategorised/285/expected.json | 10 +- .../core/uncategorised/286/expected.json | 10 +- .../core/uncategorised/287/expected.json | 16 +- .../core/uncategorised/288/expected.json | 13 +- .../core/uncategorised/289/expected.json | 8 +- .../core/uncategorised/29/expected.json | 10 +- .../core/uncategorised/290/expected.json | 16 +- .../core/uncategorised/291/expected.json | 19 +- .../core/uncategorised/292/expected.json | 13 +- .../core/uncategorised/293/expected.json | 16 +- .../core/uncategorised/294/expected.json | 13 +- .../core/uncategorised/295/expected.json | 16 +- .../core/uncategorised/296/expected.json | 13 +- .../core/uncategorised/297/expected.json | 13 +- .../core/uncategorised/298/expected.json | 16 +- .../core/uncategorised/299/expected.json | 4 +- .../core/uncategorised/30/expected.json | 7 +- .../core/uncategorised/300/expected.json | 15 +- .../core/uncategorised/301/expected.json | 15 +- .../core/uncategorised/302/expected.json | 3 +- .../core/uncategorised/303/expected.json | 9 +- .../core/uncategorised/304/expected.json | 3 +- .../core/uncategorised/305/expected.json | 3 +- .../core/uncategorised/306/expected.json | 3 +- .../core/uncategorised/307/expected.json | 3 +- .../core/uncategorised/308/expected.json | 3 +- .../core/uncategorised/309/expected.json | 3 +- .../core/uncategorised/31/expected.json | 7 +- .../core/uncategorised/310/expected.json | 7 +- .../core/uncategorised/311/expected.json | 7 +- .../core/uncategorised/312/expected.json | 7 +- .../core/uncategorised/313/expected.json | 12 +- .../core/uncategorised/314/expected.json | 6 +- .../core/uncategorised/315/expected.json | 6 +- .../core/uncategorised/316/expected.json | 3 +- .../core/uncategorised/317/expected.json | 6 +- .../core/uncategorised/318/expected.json | 4 +- .../core/uncategorised/319/expected.json | 3 +- .../core/uncategorised/32/expected.json | 7 +- .../core/uncategorised/321/expected.json | 9 +- .../core/uncategorised/323/expected.json | 6 +- .../core/uncategorised/325/expected.json | 6 +- .../core/uncategorised/326/expected.json | 12 +- .../core/uncategorised/327/expected.json | 102 ++- .../core/uncategorised/328/expected.json | 103 ++- .../core/uncategorised/329/expected.json | 122 +++- .../core/uncategorised/33/expected.json | 7 +- .../core/uncategorised/330/expected.json | 87 ++- .../core/uncategorised/331/expected.json | 136 +++- .../core/uncategorised/332/expected.json | 105 ++- .../core/uncategorised/333/expected.json | 105 ++- .../core/uncategorised/334/expected.json | 108 ++- .../core/uncategorised/335/expected.json | 211 +++++- .../core/uncategorised/336/expected.json | 140 +++- .../core/uncategorised/337/expected.json | 158 ++++- .../core/uncategorised/338/expected.json | 161 ++++- .../core/uncategorised/339/expected.json | 140 +++- .../core/uncategorised/34/expected.json | 7 +- .../core/uncategorised/340/expected.json | 152 ++++- .../core/uncategorised/342/expected.json | 6 +- .../core/uncategorised/343/expected.json | 6 +- .../core/uncategorised/344/expected.json | 6 +- .../core/uncategorised/35/expected.json | 4 +- .../core/uncategorised/36/expected.json | 4 +- .../core/uncategorised/37/expected.json | 16 +- .../core/uncategorised/38/expected.json | 16 +- .../core/uncategorised/39/expected.json | 16 +- .../core/uncategorised/40/expected.json | 16 +- .../core/uncategorised/41/expected.json | 16 +- .../core/uncategorised/42/expected.json | 13 +- .../core/uncategorised/43/expected.json | 13 +- .../core/uncategorised/44/expected.json | 6 +- .../core/uncategorised/45/expected.json | 6 +- .../core/uncategorised/525/expected.json | 6 +- .../core/uncategorised/526/expected.json | 9 +- .../core/uncategorised/527/expected.json | 3 +- .../core/uncategorised/528/expected.json | 6 +- .../core/uncategorised/529/expected.json | 9 +- .../core/uncategorised/530/expected.json | 3 +- .../core/uncategorised/531/expected.json | 6 +- .../core/uncategorised/532/expected.json | 16 +- .../core/uncategorised/533/expected.json | 3 +- .../core/uncategorised/534/expected.json | 6 +- .../core/uncategorised/535/expected.json | 9 +- .../core/uncategorised/537/expected.json | 3 +- .../core/uncategorised/539/expected.json | 142 +++- .../core/uncategorised/540/expected.json | 4 +- .../core/uncategorised/541/expected.json | 4 +- .../core/uncategorised/542/expected.json | 5 +- .../core/uncategorised/543/expected.json | 4 +- .../core/uncategorised/6/expected.json | 3 +- .../core/uncategorised/64/expected.json | 6 +- .../core/uncategorised/65/expected.json | 6 +- .../core/uncategorised/7/expected.json | 6 +- .../core/uncategorised/8/expected.json | 6 +- .../core/uncategorised/9/expected.json | 3 +- .../object-rest-spread/expected.json | 15 +- .../class-methods/linebreaks/expected.json | 8 +- .../class-methods/tricky-names/expected.json | 16 +- .../call-expression/expected.json | 6 +- .../expected.json | 9 +- .../expected.json | 7 +- .../expected.json | 10 +- .../expected.json | 7 +- .../es2015/regression/186/expected.json | 1 + .../es2015/uncategorised/.191/expected.json | 180 ----- .../es2015/uncategorised/.335/expected.json | 152 ----- .../es2015/uncategorised/.343/expected.json | 68 -- .../es2015/uncategorised/100/expected.json | 7 +- .../es2015/uncategorised/101/expected.json | 7 +- .../es2015/uncategorised/102/expected.json | 16 +- .../es2015/uncategorised/103/expected.json | 10 +- .../es2015/uncategorised/104/expected.json | 16 +- .../es2015/uncategorised/105/expected.json | 13 +- .../es2015/uncategorised/106/expected.json | 4 +- .../es2015/uncategorised/107/expected.json | 19 +- .../es2015/uncategorised/108/expected.json | 19 +- .../es2015/uncategorised/110/expected.json | 19 +- .../es2015/uncategorised/111/expected.json | 12 +- .../es2015/uncategorised/112/expected.json | 15 +- .../es2015/uncategorised/113/expected.json | 9 +- .../es2015/uncategorised/114/expected.json | 9 +- .../es2015/uncategorised/115/expected.json | 12 +- .../es2015/uncategorised/116/expected.json | 12 +- .../es2015/uncategorised/117/expected.json | 12 +- .../es2015/uncategorised/118/expected.json | 12 +- .../es2015/uncategorised/119/expected.json | 12 +- .../es2015/uncategorised/120/expected.json | 12 +- .../es2015/uncategorised/121/expected.json | 17 +- .../es2015/uncategorised/122/expected.json | 17 +- .../es2015/uncategorised/123/expected.json | 12 +- .../es2015/uncategorised/124/expected.json | 6 +- .../es2015/uncategorised/128/expected.json | 9 +- .../es2015/uncategorised/129/expected.json | 15 +- .../es2015/uncategorised/131/expected.json | 15 +- .../es2015/uncategorised/132/expected.json | 18 +- .../es2015/uncategorised/133/expected.json | 15 +- .../es2015/uncategorised/134/expected.json | 15 +- .../es2015/uncategorised/135/expected.json | 33 +- .../es2015/uncategorised/136/expected.json | 9 +- .../es2015/uncategorised/137/expected.json | 9 +- .../es2015/uncategorised/138/expected.json | 18 +- .../es2015/uncategorised/139/expected.json | 15 +- .../es2015/uncategorised/140/expected.json | 9 +- .../es2015/uncategorised/141/expected.json | 6 +- .../es2015/uncategorised/142/expected.json | 3 +- .../es2015/uncategorised/143/expected.json | 7 +- .../es2015/uncategorised/144/expected.json | 9 +- .../es2015/uncategorised/145/expected.json | 14 +- .../es2015/uncategorised/146/expected.json | 7 +- .../es2015/uncategorised/147/expected.json | 15 +- .../es2015/uncategorised/148/expected.json | 10 +- .../es2015/uncategorised/149/expected.json | 10 +- .../es2015/uncategorised/150/expected.json | 9 +- .../es2015/uncategorised/152/expected.json | 7 +- .../es2015/uncategorised/153/expected.json | 16 +- .../es2015/uncategorised/154/expected.json | 16 +- .../es2015/uncategorised/155/expected.json | 19 +- .../es2015/uncategorised/156/expected.json | 19 +- .../es2015/uncategorised/157/expected.json | 21 +- .../es2015/uncategorised/158/expected.json | 16 +- .../es2015/uncategorised/159/expected.json | 7 +- .../es2015/uncategorised/160/expected.json | 7 +- .../es2015/uncategorised/161/expected.json | 10 +- .../es2015/uncategorised/162/expected.json | 10 +- .../es2015/uncategorised/163/expected.json | 19 +- .../es2015/uncategorised/164/expected.json | 19 +- .../es2015/uncategorised/165/expected.json | 22 +- .../es2015/uncategorised/166/expected.json | 16 +- .../es2015/uncategorised/169/expected.json | 13 +- .../es2015/uncategorised/170/expected.json | 25 +- .../es2015/uncategorised/173/expected.json | 13 +- .../es2015/uncategorised/176/expected.json | 13 +- .../es2015/uncategorised/177/expected.json | 16 +- .../es2015/uncategorised/178/expected.json | 10 +- .../es2015/uncategorised/179/expected.json | 13 +- .../es2015/uncategorised/18/expected.json | 6 +- .../es2015/uncategorised/182/expected.json | 13 +- .../es2015/uncategorised/183/expected.json | 25 +- .../es2015/uncategorised/184/expected.json | 12 +- .../es2015/uncategorised/185/expected.json | 15 +- .../es2015/uncategorised/186/expected.json | 24 +- .../es2015/uncategorised/187/expected.json | 18 +- .../es2015/uncategorised/188/expected.json | 12 +- .../es2015/uncategorised/189/expected.json | 15 +- .../es2015/uncategorised/19/expected.json | 9 +- .../es2015/uncategorised/190/expected.json | 24 +- .../es2015/uncategorised/192/expected.json | 12 +- .../es2015/uncategorised/193/expected.json | 15 +- .../es2015/uncategorised/194/expected.json | 15 +- .../es2015/uncategorised/197/expected.json | 3 +- .../es2015/uncategorised/20/expected.json | 12 +- .../es2015/uncategorised/21/expected.json | 6 +- .../es2015/uncategorised/22/expected.json | 6 +- .../es2015/uncategorised/23/expected.json | 6 +- .../es2015/uncategorised/24/expected.json | 6 +- .../es2015/uncategorised/25/expected.json | 9 +- .../es2015/uncategorised/256/expected.json | 3 +- .../es2015/uncategorised/257/expected.json | 7 +- .../es2015/uncategorised/259/expected.json | 7 +- .../es2015/uncategorised/26/expected.json | 7 +- .../es2015/uncategorised/27/expected.json | 6 +- .../es2015/uncategorised/28/expected.json | 1 + .../es2015/uncategorised/29/expected.json | 4 +- .../es2015/uncategorised/292/expected.json | 12 +- .../es2015/uncategorised/299/expected.json | 18 +- .../es2015/uncategorised/30/expected.json | 4 +- .../es2015/uncategorised/300/expected.json | 10 +- .../es2015/uncategorised/301/expected.json | 6 +- .../es2015/uncategorised/302/expected.json | 6 +- .../es2015/uncategorised/303/expected.json | 12 +- .../es2015/uncategorised/304/expected.json | 12 +- .../es2015/uncategorised/305/expected.json | 15 +- .../es2015/uncategorised/306/expected.json | 17 +- .../es2015/uncategorised/307/expected.json | 15 +- .../es2015/uncategorised/308/expected.json | 13 +- .../es2015/uncategorised/309/expected.json | 18 +- .../es2015/uncategorised/31/expected.json | 7 +- .../es2015/uncategorised/310/expected.json | 13 +- .../es2015/uncategorised/313/expected.json | 9 +- .../es2015/uncategorised/314/expected.json | 11 +- .../es2015/uncategorised/315/expected.json | 19 +- .../es2015/uncategorised/316/expected.json | 11 +- .../es2015/uncategorised/317/expected.json | 3 +- .../es2015/uncategorised/318/expected.json | 3 +- .../es2015/uncategorised/319/expected.json | 3 +- .../es2015/uncategorised/32/expected.json | 4 +- .../es2015/uncategorised/320/expected.json | 3 +- .../es2015/uncategorised/321/expected.json | 12 +- .../es2015/uncategorised/322/expected.json | 3 +- .../es2015/uncategorised/323/expected.json | 16 +- .../es2015/uncategorised/33/expected.json | 10 +- .../es2015/uncategorised/338/expected.json | 4 +- .../es2015/uncategorised/34/expected.json | 7 +- .../es2015/uncategorised/35/expected.json | 7 +- .../es2015/uncategorised/350/expected.json | 184 ++++- .../es2015/uncategorised/351/expected.json | 220 +++++- .../es2015/uncategorised/352/expected.json | 220 +++++- .../es2015/uncategorised/354/expected.json | 70 +- .../es2015/uncategorised/355/expected.json | 639 +++++------------- .../es2015/uncategorised/36/expected.json | 7 +- .../es2015/uncategorised/39/expected.json | 10 +- .../es2015/uncategorised/40/expected.json | 4 +- .../es2015/uncategorised/41/expected.json | 4 +- .../es2015/uncategorised/42/expected.json | 4 +- .../es2015/uncategorised/43/expected.json | 7 +- .../es2015/uncategorised/44/expected.json | 4 +- .../es2015/uncategorised/45/expected.json | 7 +- .../es2015/uncategorised/46/expected.json | 10 +- .../es2015/uncategorised/47/expected.json | 8 +- .../es2015/uncategorised/48/expected.json | 26 +- .../es2015/uncategorised/49/expected.json | 13 +- .../es2015/uncategorised/5/expected.json | 4 +- .../es2015/uncategorised/50/expected.json | 19 +- .../es2015/uncategorised/52/expected.json | 7 +- .../es2015/uncategorised/53/expected.json | 10 +- .../es2015/uncategorised/54/expected.json | 4 +- .../es2015/uncategorised/55/expected.json | 7 +- .../es2015/uncategorised/56/expected.json | 7 +- .../es2015/uncategorised/61/expected.json | 21 +- .../es2015/uncategorised/62/expected.json | 18 +- .../es2015/uncategorised/63/expected.json | 9 +- .../es2015/uncategorised/64/expected.json | 9 +- .../es2015/uncategorised/65/expected.json | 9 +- .../es2015/uncategorised/66/expected.json | 9 +- .../es2015/uncategorised/67/expected.json | 9 +- .../es2015/uncategorised/68/expected.json | 9 +- .../es2015/uncategorised/69/expected.json | 6 +- .../es2015/uncategorised/70/expected.json | 6 +- .../es2015/uncategorised/71/expected.json | 6 +- .../es2015/uncategorised/72/expected.json | 15 +- .../es2015/uncategorised/73/expected.json | 15 +- .../es2015/uncategorised/74/expected.json | 15 +- .../es2015/uncategorised/75/expected.json | 15 +- .../es2015/uncategorised/76/expected.json | 15 +- .../es2015/uncategorised/77/expected.json | 19 +- .../es2015/uncategorised/78/expected.json | 15 +- .../es2015/uncategorised/80/expected.json | 1 + .../es2015/uncategorised/81/expected.json | 13 +- .../es2015/uncategorised/83/expected.json | 9 +- .../es2015/uncategorised/86/expected.json | 12 +- .../es2015/uncategorised/87/expected.json | 18 +- .../es2015/uncategorised/88/expected.json | 12 +- .../es2015/uncategorised/89/expected.json | 18 +- .../es2015/uncategorised/9/expected.json | 4 +- .../es2015/uncategorised/90/expected.json | 6 +- .../es2015/uncategorised/92/expected.json | 3 +- .../es2015/uncategorised/93/expected.json | 12 +- .../es2015/uncategorised/94/expected.json | 6 +- .../es2015/uncategorised/95/expected.json | 15 +- .../es2015/uncategorised/97/expected.json | 6 +- .../es2015/uncategorised/98/expected.json | 3 +- .../es2015/uncategorised/99/expected.json | 7 +- .../exponentiation-operator/2/expected.json | 5 +- .../exponentiation-operator/3/expected.json | 3 +- .../exponentiation-operator/4/expected.json | 3 +- .../exponentiation-operator/5/expected.json | 3 +- .../exponentiation-operator/7/expected.json | 6 +- .../exponentiation-operator/8/expected.json | 3 + .../es2017/async-functions/11/expected.json | 7 +- .../es2017/async-functions/12/expected.json | 17 +- .../es2017/async-functions/13/expected.json | 14 +- .../es2017/async-functions/14/expected.json | 17 +- .../es2017/async-functions/15/expected.json | 17 +- .../es2017/async-functions/16/expected.json | 16 +- .../es2017/async-functions/17/expected.json | 17 +- .../es2017/async-functions/18/expected.json | 17 +- .../es2017/async-functions/19/expected.json | 12 +- .../es2017/async-functions/20/expected.json | 15 +- .../es2017/async-functions/21/expected.json | 10 +- .../es2017/async-functions/22/expected.json | 8 +- .../es2017/async-functions/23/expected.json | 7 +- .../es2017/async-functions/24/expected.json | 7 +- .../es2017/async-functions/25/expected.json | 17 +- .../es2017/async-functions/27/expected.json | 1 + .../es2017/async-functions/28/expected.json | 1 + .../es2017/async-functions/31/expected.json | 1 + .../es2017/async-functions/32/expected.json | 1 + .../es2017/async-functions/7/expected.json | 13 +- .../es2017/async-functions/8/expected.json | 12 +- .../trailing-function-commas/1/expected.json | 6 +- .../trailing-function-commas/2/expected.json | 19 +- .../trailing-function-commas/3/expected.json | 12 +- .../trailing-function-commas/4/expected.json | 7 +- .../migrated_0000/expected.json | 15 +- .../migrated_0001/expected.json | 15 +- .../migrated_0002/expected.json | 3 +- .../migrated_0003/expected.json | 9 +- .../migrated_0004/expected.json | 3 +- .../migrated_0005/expected.json | 3 +- .../migrated_0006/expected.json | 3 +- .../migrated_0007/expected.json | 3 +- .../migrated_0008/expected.json | 3 +- .../migrated_0009/expected.json | 3 +- .../migrated_0010/expected.json | 7 +- .../migrated_0011/expected.json | 7 +- .../migrated_0012/expected.json | 7 +- .../migrated_0013/expected.json | 12 +- .../migrated_0014/expected.json | 6 +- .../migrated_0015/expected.json | 6 +- .../migrated_0000/expected.json | 3 +- .../migrated_0001/expected.json | 3 +- .../migrated_0002/expected.json | 9 +- .../migrated_0000/expected.json | 13 +- .../migrated_0001/expected.json | 10 +- .../migrated_0002/expected.json | 10 +- .../migrated_0003/expected.json | 16 +- .../migrated_0004/expected.json | 13 +- .../migrated_0005/expected.json | 8 +- .../migrated_0006/expected.json | 16 +- .../migrated_0007/expected.json | 19 +- .../migrated_0008/expected.json | 13 +- .../migrated_0009/expected.json | 13 +- .../migrated_0010/expected.json | 13 +- .../migrated_0011/expected.json | 16 +- .../migrated_0012/expected.json | 4 +- .../migrated_0013/expected.json | 13 +- .../migrated_0014/expected.json | 4 +- .../migrated_0000/expected.json | 6 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 3 +- .../migrated_0003/expected.json | 9 +- .../migrated_0000/expected.json | 7 +- .../migrated_0001/expected.json | 7 +- .../.invalid-elision-after-rest/expected.json | 150 ---- .../array-binding-pattern-01/expected.json | 4 +- .../array-binding-pattern-02/expected.json | 7 +- .../array-binding-pattern-03/expected.json | 7 +- .../array-binding-pattern-empty/expected.json | 1 + .../elision/expected.json | 1 + .../elision/expected.json | 3 +- .../empty-pattern-catch-param/expected.json | 9 +- .../empty-pattern-fn/expected.json | 10 +- .../empty-pattern-lexical/expected.json | 3 +- .../es2015-array-pattern/hole/expected.json | 6 +- .../patterned-catch/expected.json | 39 +- .../es2015-array-pattern/rest/expected.json | 3 +- .../tailing-hold/expected.json | 3 +- .../with-default-catch-param/expected.json | 3 +- .../with-default-fn/expected.json | 7 +- .../with-object-pattern/expected.json | 9 +- .../expected.json | 10 +- .../arrow-with-only-rest/expected.json | 4 +- .../migrated_0000/expected.json | 1 + .../migrated_0001/expected.json | 4 +- .../migrated_0002/expected.json | 4 +- .../migrated_0003/expected.json | 7 +- .../migrated_0004/expected.json | 4 +- .../migrated_0005/expected.json | 10 +- .../migrated_0006/expected.json | 7 +- .../migrated_0007/expected.json | 7 +- .../migrated_0008/expected.json | 10 +- .../migrated_0009/expected.json | 4 +- .../migrated_0010/expected.json | 4 +- .../migrated_0011/expected.json | 4 +- .../migrated_0012/expected.json | 7 +- .../migrated_0013/expected.json | 4 +- .../migrated_0014/expected.json | 7 +- .../migrated_0015/expected.json | 10 +- .../migrated_0016/expected.json | 8 +- .../migrated_0017/expected.json | 26 +- .../migrated_0018/expected.json | 10 +- .../migrated_0019/expected.json | 16 +- .../migrated_0020/expected.json | 10 +- .../object-binding-pattern/expected.json | 3 +- .../es2015-class/.migrated_0026/expected.json | 168 ----- .../es2015-class/migrated_0000/expected.json | 6 +- .../es2015-class/migrated_0001/expected.json | 3 +- .../es2015-class/migrated_0002/expected.json | 6 +- .../es2015-class/migrated_0003/expected.json | 6 +- .../es2015-class/migrated_0004/expected.json | 9 +- .../es2015-class/migrated_0005/expected.json | 15 +- .../es2015-class/migrated_0006/expected.json | 15 +- .../es2015-class/migrated_0007/expected.json | 15 +- .../es2015-class/migrated_0008/expected.json | 15 +- .../es2015-class/migrated_0009/expected.json | 11 +- .../es2015-class/migrated_0010/expected.json | 18 +- .../es2015-class/migrated_0011/expected.json | 24 +- .../es2015-class/migrated_0012/expected.json | 9 +- .../es2015-class/migrated_0013/expected.json | 9 +- .../es2015-class/migrated_0014/expected.json | 15 +- .../es2015-class/migrated_0015/expected.json | 9 +- .../es2015-class/migrated_0016/expected.json | 6 +- .../es2015-class/migrated_0017/expected.json | 9 +- .../es2015-class/migrated_0018/expected.json | 9 +- .../es2015-class/migrated_0019/expected.json | 9 +- .../es2015-class/migrated_0020/expected.json | 15 +- .../es2015-class/migrated_0021/expected.json | 6 +- .../es2015-class/migrated_0022/expected.json | 3 +- .../es2015-class/migrated_0023/expected.json | 6 +- .../es2015-class/migrated_0024/expected.json | 3 +- .../es2015-class/migrated_0025/expected.json | 6 +- .../migrated_0000/expected.json | 7 +- .../migrated_0001/expected.json | 7 +- .../migrated_0002/expected.json | 10 +- .../dup-assignment/expected.json | 9 +- .../member-expr-in-rest/expected.json | 3 +- .../nested-assignment/expected.json | 12 +- .../nested-cover-grammar/expected.json | 12 +- .../simple-assignment/expected.json | 3 +- .../expected.json | 3 +- .../nested-cover-grammar/expected.json | 12 +- .../object-pattern-assignment/expected.json | 54 +- .../export-const-number/expected.json | 3 +- .../export-default-array/expected.json | 3 +- .../export-default-expression/expected.json | 3 +- .../export-default-function/expected.json | 1 + .../expected.json | 10 +- .../export-default-object/expected.json | 3 +- .../export-default-value/expected.json | 6 +- .../export-from-default/expected.json | 6 +- .../expected.json | 6 +- .../expected.json | 6 +- .../expected.json | 12 +- .../export-from-specifier/expected.json | 6 +- .../export-from-specifiers/expected.json | 12 +- .../export-function-declaration/expected.json | 4 +- .../export-function/expected.json | 10 +- .../export-let-number/expected.json | 3 +- .../export-named-as-default/expected.json | 9 +- .../export-named-as-specifier/expected.json | 9 +- .../export-named-as-specifiers/expected.json | 15 +- .../export-named-empty/expected.json | 3 +- .../export-named-specifier/expected.json | 9 +- .../expected.json | 15 +- .../export-named-specifiers/expected.json | 15 +- .../expected.json | 10 +- .../export-var-number/expected.json | 3 +- .../export-var/expected.json | 6 +- .../for-of-array-pattern-let/expected.json | 13 +- .../for-of-array-pattern/expected.json | 13 +- .../for-of-object-pattern-const/expected.json | 22 +- .../for-of-object-pattern/expected.json | 22 +- .../for-of-with-const/expected.json | 10 +- .../for-of-with-let/expected.json | 10 +- .../for-of-with-var/expected.json | 10 +- .../es2015-for-of/for-of/expected.json | 11 +- .../es2015-for-of/let-of-of/expected.json | 10 +- .../expected.json | 153 ----- .../expected.json | 19 +- .../expected.json | 4 +- .../expected.json | 4 +- .../generator-declaration/expected.json | 10 +- .../expected.json | 7 +- .../expected.json | 13 +- .../expected.json | 16 +- .../expected.json | 4 +- .../generator-expression/expected.json | 4 +- .../expected.json | 16 +- .../expected.json | 7 +- .../expected.json | 7 +- .../expected.json | 7 +- .../generator-method-with-yield/expected.json | 7 +- .../generator-method/expected.json | 7 +- .../expected.json | 11 +- .../static-generator-method/expected.json | 11 +- .../.invalid_function_wait/expected.json | 83 --- .../.invalid_lone_surrogate/expected.json | 100 --- .../dakuten_handakuten/expected.json | 9 +- .../escaped_all/expected.json | 6 +- .../escaped_math_alef/expected.json | 6 +- .../escaped_math_dal_part/expected.json | 6 +- .../escaped_math_kaf_lam/expected.json | 6 +- .../escaped_math_zain_start/expected.json | 6 +- .../escaped_part/expected.json | 6 +- .../escaped_start/expected.json | 6 +- .../es2015-identifier/estimated/expected.json | 6 +- .../ethiopic_digits/expected.json | 6 +- .../es2015-identifier/math_alef/expected.json | 6 +- .../math_dal_part/expected.json | 6 +- .../math_kaf_lam/expected.json | 6 +- .../math_zain_start/expected.json | 6 +- .../module_await/expected.json | 3 +- .../valid_await/expected.json | 9 +- .../weierstrass/expected.json | 6 +- .../weierstrass_weierstrass/expected.json | 6 +- .../expected.json | 9 +- .../expected.json | 6 +- .../import-default-as/expected.json | 6 +- .../import-default/expected.json | 3 +- .../import-jquery/expected.json | 3 +- .../import-named-as-specifier/expected.json | 6 +- .../import-named-as-specifiers/expected.json | 12 +- .../import-named-specifier/expected.json | 6 +- .../expected.json | 12 +- .../import-named-specifiers/expected.json | 12 +- .../import-namespace-specifier/expected.json | 3 +- .../import-null-as-nil/expected.json | 6 +- .../migrated_0000/expected.json | 6 +- .../.invalid-new-target/expected.json | 129 ---- .../assign-new-target/expected.json | 19 +- .../new-new-target/expected.json | 16 +- .../new-target-declaration/expected.json | 16 +- .../new-target-expression/expected.json | 16 +- .../new-target-invoke/expected.json | 16 +- .../new-target-precedence/expected.json | 16 +- .../migrated_0000/expected.json | 7 +- .../migrated_0001/expected.json | 10 +- .../migrated_0002/expected.json | 4 +- .../migrated_0003/expected.json | 7 +- .../migrated_0004/expected.json | 7 +- .../expected.json | 17 +- .../proto-identifier-getter/expected.json | 10 +- .../proto-identifier-method/expected.json | 10 +- .../proto-identifier-setter/expected.json | 13 +- .../proto-literal-getter-setter/expected.json | 14 +- .../proto-literal-getter/expected.json | 7 +- .../proto-literal-method/expected.json | 7 +- .../proto-literal-setter/expected.json | 10 +- .../migrated_0000/expected.json | 21 +- .../elision/expected.json | 9 +- .../empty-catch-param/expected.json | 9 +- .../empty-fn/expected.json | 10 +- .../empty-for-lex/expected.json | 1 + .../nested/expected.json | 3 +- .../properties/expected.json | 36 +- .../migrated_0002/expected.json | 4 +- .../migrated_0006/expected.json | 4 +- .../function-declaration/expected.json | 16 +- .../function-expression/expected.json | 16 +- .../object-method/expected.json | 13 +- .../object-shorthand-method/expected.json | 10 +- .../call-multi-spread/expected.json | 15 +- .../call-spread-default/expected.json | 15 +- .../call-spread-first/expected.json | 15 +- .../call-spread-number/expected.json | 3 +- .../call-spread/expected.json | 9 +- .../new-multi-spread/expected.json | 15 +- .../new-spread-default/expected.json | 15 +- .../new-spread-first/expected.json | 15 +- .../new-spread-number/expected.json | 3 +- .../new-spread/expected.json | 9 +- .../.invalid_super_id/expected.json | 232 ------- .../arrow_super/expected.json | 13 +- .../constructor_super/expected.json | 12 +- .../new_super/expected.json | 15 +- .../super_computed/expected.json | 12 +- .../super_member/expected.json | 15 +- .../.octal-literal/expected.json | 86 --- .../.strict-octal-literal/expected.json | 119 ---- .../dollar-sign/expected.json | 3 +- .../escape-sequences/expected.json | 3 +- .../line-terminators/expected.json | 3 +- .../literal-escape-sequences/expected.json | 3 +- .../new-expression/expected.json | 6 +- .../tagged-interpolation/expected.json | 9 +- .../expected.json | 6 +- .../tagged/expected.json | 6 +- .../untagged/expected.json | 3 +- .../migrated_0000/expected.json | 3 +- .../migrated_0001/expected.json | 3 +- .../migrated_0002/expected.json | 3 +- .../expected.json | 200 ------ .../expected.json | 99 --- .../expected.json | 101 --- .../expected.json | 132 ---- .../expected.json | 100 --- .../expected.json | 163 ----- .../expected.json | 150 ---- .../expected.json | 164 ----- .../expected.json | 136 ---- .../expected.json | 183 ----- .../expected.json | 185 ----- .../yield-array-pattern/expected.json | 9 +- .../yield-arrow-concise-body/expected.json | 13 +- .../yield-arrow-function-body/expected.json | 16 +- .../expected.json | 13 +- .../yield-arrow-parameter-name/expected.json | 4 +- .../yield-binding-element/expected.json | 9 +- .../yield-binding-property/expected.json | 9 +- .../expected.json | 16 +- .../yield-catch-parameter/expected.json | 12 +- .../yield-expression-precedence/expected.json | 25 +- .../expected.json | 13 +- .../yield-function-declaration/expected.json | 10 +- .../expected.json | 7 +- .../yield-function-expression/expected.json | 7 +- .../expected.json | 17 +- .../expected.json | 23 +- .../yield-generator-declaration/expected.json | 10 +- .../expected.json | 16 +- .../yield-generator-method/expected.json | 7 +- .../expected.json | 10 +- .../yield-lexical-declaration/expected.json | 3 +- .../expected.json | 16 +- .../es2015-yield/yield-method/expected.json | 7 +- .../expected.json | 10 +- .../yield-rest-parameter/expected.json | 13 +- .../expected.json | 9 +- .../yield-strict-method/expected.json | 7 +- .../yield-super-property/expected.json | 15 +- .../yield-variable-declaration/expected.json | 6 +- .../expected.json | 10 +- .../yield-yield-expression/expected.json | 10 +- .../migrated_0000/expected.json | 9 +- .../migrated_0001/expected.json | 9 +- .../migrated_0000/expected.json | 3 +- .../migrated_0001/expected.json | 3 +- .../migrated_0002/expected.json | 3 +- .../migrated_0003/expected.json | 3 +- .../migrated_0004/expected.json | 3 +- .../migrated_0005/expected.json | 3 +- .../migrated_0006/expected.json | 3 +- .../migrated_0007/expected.json | 3 +- .../migrated_0008/expected.json | 3 +- .../migrated_0009/expected.json | 3 +- .../migrated_0010/expected.json | 3 +- .../migrated_0011/expected.json | 3 +- .../migrated_0012/expected.json | 3 +- .../migrated_0013/expected.json | 3 +- .../migrated_0000/expected.json | 9 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 9 +- .../migrated_0000/expected.json | 9 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 12 +- .../migrated_0003/expected.json | 12 +- .../migrated_0004/expected.json | 12 +- .../migrated_0005/expected.json | 12 +- .../migrated_0000/expected.json | 12 +- .../migrated_0001/expected.json | 12 +- .../migrated_0002/expected.json | 12 +- .../migrated_0003/expected.json | 12 +- .../migrated_0004/expected.json | 12 +- .../migrated_0005/expected.json | 12 +- .../migrated_0006/expected.json | 12 +- .../migrated_0007/expected.json | 12 +- .../migrated_0008/expected.json | 12 +- .../migrated_0009/expected.json | 12 +- .../migrated_0010/expected.json | 12 +- .../migrated_0011/expected.json | 12 +- .../migrated_0012/expected.json | 12 +- .../migrated_0013/expected.json | 12 +- .../migrated_0014/expected.json | 12 +- .../migrated_0015/expected.json | 12 +- .../migrated_0016/expected.json | 12 +- .../migrated_0017/expected.json | 12 +- .../migrated_0000/expected.json | 9 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 9 +- .../migrated_0000/expected.json | 36 +- .../migrated_0000/expected.json | 3 +- .../migrated_0001/expected.json | 6 +- .../migrated_0002/expected.json | 6 +- .../migrated_0000/expected.json | 9 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 9 +- .../migrated_0003/expected.json | 9 +- .../migrated_0000/expected.json | 6 +- .../migrated_0001/expected.json | 3 +- .../migrated_0000/expected.json | 6 +- .../migrated_0001/expected.json | 6 +- .../migrated_0002/expected.json | 6 +- .../migrated_0003/expected.json | 6 +- .../migrated_0004/expected.json | 9 +- .../migrated_0005/expected.json | 9 +- .../migrated_0006/expected.json | 9 +- .../migrated_0007/expected.json | 9 +- .../migrated_0008/expected.json | 12 +- .../migrated_0009/expected.json | 6 +- .../migrated_0010/expected.json | 9 +- .../migrated_0011/expected.json | 12 +- .../migrated_0012/expected.json | 15 +- .../migrated_0013/expected.json | 12 +- .../migrated_0014/expected.json | 9 +- .../migrated_0015/expected.json | 6 +- .../migrated_0016/expected.json | 6 +- .../migrated_0017/expected.json | 9 +- .../migrated_0018/expected.json | 12 +- .../migrated_0019/expected.json | 9 +- .../migrated_0020/expected.json | 9 +- .../migrated_0021/expected.json | 9 +- .../migrated_0022/expected.json | 9 +- .../migrated_0000/expected.json | 9 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 9 +- .../migrated_0000/expected.json | 6 +- .../migrated_0001/expected.json | 6 +- .../migrated_0002/expected.json | 6 +- .../migrated_0003/expected.json | 6 +- .../migrated_0004/expected.json | 6 +- .../migrated_0005/expected.json | 6 +- .../expression-primary/array/expected.json | 3 +- .../expression-primary/literal/expected.json | 3 +- .../expression-primary/object/expected.json | 3 +- .../expression-primary/other/expected.json | 3 +- .../migrated_0000/expected.json | 9 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 9 +- .../migrated_0003/expected.json | 9 +- .../migrated_0004/expected.json | 9 +- .../migrated_0005/expected.json | 9 +- .../migrated_0006/expected.json | 12 +- .../migrated_0000/expected.json | 9 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 9 +- .../migrated_0003/expected.json | 9 +- .../migrated_0004/expected.json | 9 +- .../migrated_0005/expected.json | 9 +- .../migrated_0006/expected.json | 9 +- .../migrated_0007/expected.json | 9 +- .../migrated_0008/expected.json | 9 +- .../migrated_0009/expected.json | 9 +- .../migrated_0010/expected.json | 9 +- .../migrated_0011/expected.json | 9 +- .../migrated_0012/expected.json | 9 +- .../invalid-syntax/.GH-1106-09/expected.json | 66 -- .../.migrated_0033/expected.json | 100 --- .../.migrated_0034/expected.json | 100 --- .../.migrated_0035/expected.json | 102 --- .../.migrated_0036/expected.json | 100 --- .../.migrated_0037/expected.json | 100 --- .../.migrated_0041/expected.json | 100 --- .../.migrated_0042/expected.json | 100 --- .../.migrated_0043/expected.json | 100 --- .../.migrated_0044/expected.json | 100 --- .../.migrated_0048/expected.json | 100 --- .../.migrated_0049/expected.json | 100 --- .../.migrated_0050/expected.json | 100 --- .../.migrated_0051/expected.json | 100 --- .../.migrated_0137/expected.json | 100 --- .../.migrated_0163/expected.json | 100 --- .../.migrated_0165/expected.json | 100 --- .../.migrated_0166/expected.json | 100 --- .../.migrated_0167/expected.json | 100 --- .../.migrated_0169/expected.json | 100 --- .../.migrated_0277/expected.json | 168 ----- .../migrated_0000/expected.json | 9 +- .../migrated_0001/expected.json | 12 +- .../migrated_0002/expected.json | 6 +- .../migrated_0001/expected.json | 6 +- .../migrated_0002/expected.json | 6 +- .../migrated_0003/expected.json | 6 +- .../migrated_0002/expected.json | 6 +- .../migrated_0003/expected.json | 6 +- .../migrated_0004/expected.json | 6 +- .../migrated_0000/expected.json | 3 +- .../migrated_0000/expected.json | 3 +- .../migrated_0000/expected.json | 6 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 3 +- .../migrated_0003/expected.json | 3 +- .../migrated_0004/expected.json | 3 +- .../migrated_0005/expected.json | 3 +- .../statement-if/migrated_0000/expected.json | 9 +- .../statement-if/migrated_0001/expected.json | 7 +- .../statement-if/migrated_0002/expected.json | 6 +- .../statement-if/migrated_0004/expected.json | 12 +- .../statement-if/migrated_0005/expected.json | 3 +- .../statement-if/migrated_0006/expected.json | 3 +- .../.migrated_0021/expected.json | 176 ----- .../const_forin/expected.json | 16 +- .../for-statement-with-seq/expected.json | 12 +- .../migrated_0000/expected.json | 3 +- .../migrated_0001/expected.json | 3 +- .../migrated_0002/expected.json | 9 +- .../migrated_0004/expected.json | 3 +- .../migrated_0005/expected.json | 3 +- .../migrated_0006/expected.json | 3 +- .../migrated_0007/expected.json | 9 +- .../migrated_0008/expected.json | 3 +- .../migrated_0009/expected.json | 6 +- .../migrated_0010/expected.json | 3 +- .../migrated_0011/expected.json | 3 +- .../migrated_0012/expected.json | 3 +- .../migrated_0013/expected.json | 6 +- .../migrated_0014/expected.json | 6 +- .../migrated_0015/expected.json | 9 +- .../migrated_0016/expected.json | 15 +- .../migrated_0017/expected.json | 16 +- .../migrated_0018/expected.json | 16 +- .../migrated_0020/expected.json | 16 +- .../migrated_0024/expected.json | 16 +- .../migrated_0025/expected.json | 13 +- .../migrated_0026/expected.json | 13 +- .../migrated_0000/expected.json | 9 +- .../migrated_0001/expected.json | 6 +- .../migrated_0002/expected.json | 9 +- .../migrated_0000/expected.json | 4 +- .../migrated_0001/expected.json | 4 +- .../migrated_0002/expected.json | 7 +- .../migrated_0003/expected.json | 10 +- .../migrated_0000/expected.json | 6 +- .../migrated_0001/expected.json | 6 +- .../migrated_0002/expected.json | 6 +- .../migrated_0000/expected.json | 6 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 3 +- .../statement-try/migrated_0000/expected.json | 12 +- .../statement-try/migrated_0001/expected.json | 12 +- .../statement-try/migrated_0002/expected.json | 12 +- .../statement-try/migrated_0003/expected.json | 18 +- .../statement-try/migrated_0004/expected.json | 15 +- .../statement-try/migrated_0005/expected.json | 21 +- .../statement-try/migrated_0006/expected.json | 30 +- .../migrated_0000/expected.json | 6 +- .../migrated_0001/expected.json | 9 +- .../migrated_0002/expected.json | 3 +- .../migrated_0003/expected.json | 6 +- .../migrated_0004/expected.json | 9 +- .../migrated_0005/expected.json | 12 +- .../migrated_0006/expected.json | 15 +- .../migrated_0000/expected.json | 12 +- .../migrated_0001/expected.json | 12 +- .../migrated_0002/expected.json | 15 +- .../estree/class-method/basic/expected.json | 8 +- .../estree/literal/boolean/expected.json | 2 +- .../estree/literal/null/expected.json | 2 +- .../estree/literal/number/expected.json | 2 +- .../estree/literal/regexp/expected.json | 2 +- .../estree/literal/string/expected.json | 2 +- .../object-property/basic/expected.json | 2 +- .../class-method-2/expected.json | 2 +- .../class-method/expected.json | 26 +- .../async-generators/for-await/expected.json | 11 +- .../object-method/expected.json | 24 +- .../asi-success/expected.json | 27 +- .../class-properties/computed/expected.json | 8 +- .../class-properties/edge-cases/expected.json | 4 +- .../class-method-parameter/expected.json | 27 +- .../expected.json | 2 +- .../computed-member-expression/expected.json | 2 +- .../export-decorators-on-class/expected.json | 38 +- .../expected.json | 22 +- .../expected.json | 36 +- .../expected.json | 22 +- .../expected.json | 22 +- .../object-method-parameter/expected.json | 25 +- .../inside-generator/expected.json | 10 +- .../object-rest-spread/1/expected.json | 8 +- .../object-rest-spread/10/expected.json | 2 +- .../object-rest-spread/16/expected.json | 2 +- .../object-rest-spread/17/expected.json | 2 +- .../object-rest-spread/2/expected.json | 17 +- .../object-rest-spread/3/expected.json | 18 +- .../object-rest-spread/4/expected.json | 11 +- .../object-rest-spread/5/expected.json | 17 +- .../object-rest-spread/6/expected.json | 2 +- .../uncategorised/33/expected.json | 9 +- .../uncategorised/34/expected.json | 12 +- .../uncategorised/35/expected.json | 12 +- .../uncategorised/36/expected.json | 15 +- .../uncategorised/37/expected.json | 12 +- .../uncategorised/38/expected.json | 15 +- .../uncategorised/39/expected.json | 15 +- .../uncategorised/40/expected.json | 15 +- .../uncategorised/43/expected.json | 8 +- .../uncategorised/44/expected.json | 11 +- .../uncategorised/45/expected.json | 11 +- .../uncategorised/46/expected.json | 8 +- .../uncategorised/47/expected.json | 11 +- .../uncategorised/48/expected.json | 11 +- .../uncategorised/49/expected.json | 9 +- .../uncategorised/50/expected.json | 9 +- .../uncategorised/51/expected.json | 9 +- .../uncategorised/52/expected.json | 3 +- .../uncategorised/53/expected.json | 3 +- .../uncategorised/54/expected.json | 3 +- .../uncategorised/62/expected.json | 13 +- .../good_03/expected.json | 3 +- .../good_04/expected.json | 3 +- .../good_05/expected.json | 7 +- .../good_01/expected.json | 3 +- .../good_10/expected.json | 7 +- .../good_11/expected.json | 3 +- .../good_12/expected.json | 3 +- .../good_13/expected.json | 7 +- .../good_14/expected.json | 11 +- .../fixtures/flow/array-types/1/expected.json | 9 +- .../fixtures/flow/array-types/2/expected.json | 9 +- .../fixtures/flow/array-types/3/expected.json | 9 +- .../fixtures/flow/array-types/4/expected.json | 9 +- .../fixtures/flow/array-types/5/expected.json | 9 +- .../fixtures/flow/array-types/6/expected.json | 12 +- .../fixtures/flow/array-types/7/expected.json | 11 +- .../fixtures/flow/array-types/8/expected.json | 12 +- .../fixtures/flow/array-types/9/expected.json | 12 +- .../flow/bounded-polymorphism/1/expected.json | 7 +- .../flow/bounded-polymorphism/2/expected.json | 4 +- .../flow/call-properties/1/expected.json | 13 +- .../flow/call-properties/2/expected.json | 13 +- .../flow/call-properties/3/expected.json | 21 +- .../flow/call-properties/4/expected.json | 16 +- .../flow/call-properties/5/expected.json | 13 +- .../flow/declare-module/1/expected.json | 9 +- .../flow/declare-module/3/expected.json | 12 +- .../flow/declare-module/4/expected.json | 15 +- .../flow/declare-module/5/expected.json | 20 +- .../flow/declare-module/6/expected.json | 10 +- .../flow/declare-statements/1/expected.json | 9 +- .../flow/declare-statements/10/expected.json | 19 +- .../flow/declare-statements/11/expected.json | 16 +- .../flow/declare-statements/12/expected.json | 13 +- .../flow/declare-statements/13/expected.json | 15 +- .../flow/declare-statements/14/expected.json | 19 +- .../flow/declare-statements/15/expected.json | 26 +- .../flow/declare-statements/16/expected.json | 3 +- .../flow/declare-statements/2/expected.json | 9 +- .../flow/declare-statements/3/expected.json | 12 +- .../flow/declare-statements/4/expected.json | 12 +- .../flow/declare-statements/5/expected.json | 9 +- .../flow/declare-statements/6/expected.json | 18 +- .../flow/declare-statements/7/expected.json | 26 +- .../flow/declare-statements/8/expected.json | 13 +- .../flow/declare-statements/9/expected.json | 19 +- .../flow/def-site-variance/1/expected.json | 38 +- .../1/expected.json | 13 +- .../2/expected.json | 16 +- .../3/expected.json | 21 +- .../4/expected.json | 17 +- .../5/expected.json | 23 +- .../6/expected.json | 12 +- .../7/expected.json | 18 +- .../8/expected.json | 15 +- .../9/expected.json | 18 +- .../literal-types/boolean-false/expected.json | 6 +- .../literal-types/boolean-true/expected.json | 6 +- .../flow/literal-types/null/expected.json | 8 +- .../literal-types/number-binary/expected.json | 7 +- .../literal-types/number-float/expected.json | 7 +- .../number-integer/expected.json | 7 +- .../number-negative-binary/expected.json | 9 +- .../number-negative-float/expected.json | 9 +- .../number-negative-octal-2/expected.json | 9 +- .../number-negative-octal/expected.json | 9 +- .../number-octal-2/expected.json | 7 +- .../literal-types/number-octal/expected.json | 7 +- .../literal-types/string-double/expected.json | 17 +- .../literal-types/string-single/expected.json | 17 +- .../flow/optional-type/1/expected.json | 6 +- .../flow/optional-type/3/expected.json | 12 +- .../flow/optional-type/4/expected.json | 6 +- test/fixtures/flow/predicates/1/expected.json | 2 +- test/fixtures/flow/predicates/2/expected.json | 2 +- test/fixtures/flow/predicates/3/expected.json | 2 +- test/fixtures/flow/predicates/6/expected.json | 13 +- .../qualified-generic-type/1/expected.json | 15 +- .../qualified-generic-type/2/expected.json | 18 +- .../qualified-generic-type/3/expected.json | 18 +- .../qualified-generic-type/4/expected.json | 18 +- .../expected.json | 166 ----- .../flow/regression/issue-2083/expected.json | 37 +- .../flow/regression/issue-2493/expected.json | 79 ++- .../1/expected.json | 102 +-- test/fixtures/flow/tuples/1/expected.json | 9 +- test/fixtures/flow/tuples/2/expected.json | 18 +- test/fixtures/flow/tuples/3/expected.json | 3 +- test/fixtures/flow/tuples/4/expected.json | 3 +- test/fixtures/flow/type-alias/1/expected.json | 9 +- test/fixtures/flow/type-alias/2/expected.json | 12 +- test/fixtures/flow/type-alias/3/expected.json | 16 +- test/fixtures/flow/type-alias/4/expected.json | 24 +- .../flow/type-annotations/1/expected.json | 10 +- .../flow/type-annotations/10/expected.json | 13 +- .../flow/type-annotations/100/expected.json | 182 ++--- .../flow/type-annotations/101/expected.json | 14 +- .../flow/type-annotations/102/expected.json | 11 +- .../flow/type-annotations/103/expected.json | 18 +- .../flow/type-annotations/104/expected.json | 24 +- .../flow/type-annotations/107/expected.json | 2 +- .../flow/type-annotations/108/expected.json | 12 + .../flow/type-annotations/11/expected.json | 16 +- .../flow/type-annotations/110/expected.json | 2 +- .../flow/type-annotations/111/expected.json | 2 +- .../flow/type-annotations/114/expected.json | 2 +- .../flow/type-annotations/115/expected.json | 2 +- .../flow/type-annotations/118/expected.json | 2 +- .../flow/type-annotations/119/expected.json | 2 +- .../flow/type-annotations/12/expected.json | 7 +- .../flow/type-annotations/129/expected.json | 8 +- .../flow/type-annotations/13/expected.json | 7 +- .../flow/type-annotations/130/expected.json | 19 +- .../flow/type-annotations/14/expected.json | 10 +- .../flow/type-annotations/15/expected.json | 10 +- .../flow/type-annotations/16/expected.json | 10 +- .../flow/type-annotations/17/expected.json | 6 +- .../flow/type-annotations/18/expected.json | 9 +- .../flow/type-annotations/19/expected.json | 9 +- .../flow/type-annotations/2/expected.json | 7 +- .../flow/type-annotations/20/expected.json | 10 +- .../flow/type-annotations/21/expected.json | 13 +- .../flow/type-annotations/22/expected.json | 10 +- .../flow/type-annotations/23/expected.json | 21 +- .../flow/type-annotations/24/expected.json | 21 +- .../flow/type-annotations/25/expected.json | 21 +- .../flow/type-annotations/26/expected.json | 18 +- .../flow/type-annotations/27/expected.json | 11 +- .../flow/type-annotations/28/expected.json | 14 +- .../flow/type-annotations/29/expected.json | 11 +- .../flow/type-annotations/3/expected.json | 10 +- .../flow/type-annotations/30/expected.json | 9 +- .../flow/type-annotations/31/expected.json | 12 +- .../flow/type-annotations/32/expected.json | 16 +- .../flow/type-annotations/33/expected.json | 16 +- .../flow/type-annotations/34/expected.json | 20 +- .../flow/type-annotations/35/expected.json | 16 +- .../flow/type-annotations/36/expected.json | 20 +- .../flow/type-annotations/37/expected.json | 23 +- .../flow/type-annotations/38/expected.json | 23 +- .../flow/type-annotations/39/expected.json | 20 +- .../flow/type-annotations/4/expected.json | 10 +- .../flow/type-annotations/40/expected.json | 20 +- .../flow/type-annotations/41/expected.json | 25 +- .../flow/type-annotations/42/expected.json | 25 +- .../flow/type-annotations/43/expected.json | 22 +- .../flow/type-annotations/44/expected.json | 6 +- .../flow/type-annotations/45/expected.json | 9 +- .../flow/type-annotations/46/expected.json | 15 +- .../flow/type-annotations/47/expected.json | 6 +- .../flow/type-annotations/48/expected.json | 12 +- .../flow/type-annotations/49/expected.json | 12 +- .../flow/type-annotations/5/expected.json | 10 +- .../flow/type-annotations/50/expected.json | 17 +- .../flow/type-annotations/51/expected.json | 8 +- .../flow/type-annotations/52/expected.json | 10 +- .../flow/type-annotations/53/expected.json | 21 +- .../flow/type-annotations/54/expected.json | 21 +- .../flow/type-annotations/55/expected.json | 3 +- .../flow/type-annotations/56/expected.json | 11 +- .../flow/type-annotations/57/expected.json | 12 +- .../flow/type-annotations/58/expected.json | 15 +- .../flow/type-annotations/59/expected.json | 15 +- .../flow/type-annotations/6/expected.json | 7 +- .../flow/type-annotations/60/expected.json | 19 +- .../flow/type-annotations/61/expected.json | 19 +- .../flow/type-annotations/62/expected.json | 6 +- .../flow/type-annotations/63/expected.json | 19 +- .../flow/type-annotations/64/expected.json | 10 +- .../flow/type-annotations/65/expected.json | 10 +- .../flow/type-annotations/66/expected.json | 10 +- .../flow/type-annotations/67/expected.json | 10 +- .../flow/type-annotations/68/expected.json | 71 +- .../flow/type-annotations/69/expected.json | 17 +- .../flow/type-annotations/7/expected.json | 7 +- .../flow/type-annotations/70/expected.json | 6 +- .../flow/type-annotations/71/expected.json | 9 +- .../flow/type-annotations/72/expected.json | 13 +- .../flow/type-annotations/73/expected.json | 74 +- .../flow/type-annotations/74/expected.json | 77 ++- .../flow/type-annotations/75/expected.json | 6 +- .../flow/type-annotations/76/expected.json | 9 +- .../flow/type-annotations/77/expected.json | 9 +- .../flow/type-annotations/78/expected.json | 15 +- .../flow/type-annotations/79/expected.json | 74 +- .../flow/type-annotations/8/expected.json | 7 +- .../flow/type-annotations/80/expected.json | 15 +- .../flow/type-annotations/81/expected.json | 15 +- .../flow/type-annotations/82/expected.json | 15 +- .../flow/type-annotations/83/expected.json | 9 +- .../flow/type-annotations/84/expected.json | 9 +- .../flow/type-annotations/85/expected.json | 12 +- .../flow/type-annotations/86/expected.json | 15 +- .../flow/type-annotations/87/expected.json | 15 +- .../flow/type-annotations/88/expected.json | 21 +- .../flow/type-annotations/89/expected.json | 3 +- .../flow/type-annotations/9/expected.json | 10 +- .../flow/type-annotations/90/expected.json | 3 +- .../flow/type-annotations/91/expected.json | 14 +- .../flow/type-annotations/92/expected.json | 7 +- .../flow/type-annotations/93/expected.json | 3 +- .../flow/type-annotations/94/expected.json | 10 +- .../flow/type-annotations/95/expected.json | 3 +- .../flow/type-annotations/96/expected.json | 3 +- .../flow/type-annotations/97/expected.json | 6 +- .../flow/type-annotations/98/expected.json | 26 +- .../flow/type-annotations/99/expected.json | 371 ++-------- .../arrow-func-return-newline/expected.json | 3 +- .../type-annotations/builtin/expected.json | 8 +- .../existential-type-param-2/expected.json | 11 +- .../existential-type-param/expected.json | 14 +- .../negative-number-literal/expected.json | 14 +- .../flow/type-exports/alias/expected.json | 8 +- .../flow/type-exports/interface/expected.json | 28 +- .../type-exports/specifier-from/expected.json | 6 +- .../flow/type-exports/specifier/expected.json | 11 +- .../flow/type-grouping/1/expected.json | 9 +- .../flow/type-grouping/2/expected.json | 9 +- .../flow/type-grouping/3/expected.json | 9 +- .../flow/type-grouping/4/expected.json | 12 +- .../import-type-shorthand/expected.json | 2 +- .../type-imports/import-type/expected.json | 2 + .../arrow_with_jsx/expected.json | 23 +- .../arrow_without_jsx/expected.json | 23 +- .../class-method-reserved-word/expected.json | 40 +- .../expected.json | 24 +- .../expected.json | 12 +- .../default/expected.json | 2 +- .../interface-reserved-word/expected.json | 12 +- .../expected.json | 3 +- .../object-reserved-word/expected.json | 12 +- .../type-object-reserved-word/expected.json | 12 +- test/fixtures/flow/typecasts/1/expected.json | 6 +- test/fixtures/flow/typecasts/2/expected.json | 20 +- test/fixtures/flow/typecasts/3/expected.json | 13 +- test/fixtures/flow/typecasts/4/expected.json | 15 +- test/fixtures/jsx/basic/1/expected.json | 6 +- test/fixtures/jsx/basic/14/expected.json | 6 +- test/fixtures/jsx/basic/15/expected.json | 6 +- test/fixtures/jsx/basic/16/expected.json | 6 +- test/fixtures/jsx/basic/17/expected.json | 9 +- test/fixtures/jsx/basic/18/expected.json | 3 +- test/fixtures/jsx/basic/19/expected.json | 3 +- test/fixtures/jsx/basic/2/expected.json | 6 +- test/fixtures/jsx/basic/20/expected.json | 30 +- test/fixtures/jsx/basic/21/expected.json | 17 +- test/fixtures/jsx/basic/3/expected.json | 3 +- test/fixtures/jsx/basic/5/expected.json | 6 +- test/fixtures/jsx/basic/6/expected.json | 6 +- test/fixtures/jsx/basic/8/expected.json | 9 +- test/fixtures/jsx/basic/asi/expected.json | 7 +- .../empty-expression-container/expected.json | 13 +- test/fixtures/jsx/basic/entity/expected.json | 4 +- .../jsx/basic/keyword-tag/expected.json | 3 +- .../jsx/basic/namespace-tag/expected.json | 3 +- .../jsx/basic/yield-tag/expected.json | 335 ++++----- test/fixtures/jsx/regression/2/expected.json | 9 +- test/fixtures/jsx/regression/3/expected.json | 9 +- test/fixtures/jsx/regression/5/expected.json | 12 +- test/fixtures/jsx/regression/6/expected.json | 3 +- .../jsx/regression/issue-2083/expected.json | 3 +- test/utils/runFixtureTests.js | 16 +- 1379 files changed, 12535 insertions(+), 11482 deletions(-) create mode 100644 scripts/rmExpected.js mode change 100755 => 100644 test/fixtures/comments/basic/block-trailing-comment/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/comment-within-condition/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/export-default-anonymous-class/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/surrounding-call-comments/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/surrounding-debugger-comments/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/surrounding-return-comments/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/surrounding-throw-comments/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/surrounding-while-loop-comments/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/switch-fallthrough-comment-in-function/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/switch-fallthrough-comment/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/switch-no-default-comment-in-function/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/expected.json mode change 100755 => 100644 test/fixtures/comments/basic/switch-no-default-comment/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/.191/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/.335/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/.343/expected.json delete mode 100644 test/fixtures/esprima/es2015-array-binding-pattern/.invalid-elision-after-rest/expected.json delete mode 100644 test/fixtures/esprima/es2015-class/.migrated_0026/expected.json delete mode 100644 test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json delete mode 100644 test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json delete mode 100644 test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/expected.json delete mode 100644 test/fixtures/esprima/es2015-meta-property/.invalid-new-target/expected.json delete mode 100644 test/fixtures/esprima/es2015-super-property/.invalid_super_id/expected.json delete mode 100644 test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json delete mode 100644 test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.yield-generator-arrow-concise-body/expected.json delete mode 100644 test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0033/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0034/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0035/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0036/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0037/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0041/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0042/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0043/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0044/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0048/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0049/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0050/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0051/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0137/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0163/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0165/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0166/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0167/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0169/expected.json delete mode 100644 test/fixtures/esprima/invalid-syntax/.migrated_0277/expected.json delete mode 100644 test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json delete mode 100644 test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json diff --git a/scripts/rmExpected.js b/scripts/rmExpected.js new file mode 100644 index 0000000000..613071b02f --- /dev/null +++ b/scripts/rmExpected.js @@ -0,0 +1,24 @@ +// Use this to remove all "expected.json" in all tests. + +const { existsSync, readdirSync, statSync, unlinkSync } = require("fs"); +const { join } = require("path"); + +const rootPath = join(__dirname, "..", "test", "fixtures"); + +for (const fixtureName of readdirSync(rootPath)) { + const fixturePath = join(rootPath, fixtureName); + for (const suiteName of readdirSync(fixturePath)) { + const suitePath = join(fixturePath, suiteName); + if (!statSync(suitePath).isDirectory()) { + continue; + } + + for (const testName of readdirSync(suitePath)) { + const testPath = join(suitePath, testName); + const expectedPath = join(testPath, "expected.json"); + if (existsSync(expectedPath)) { + unlinkSync(expectedPath); + } + } + } +} diff --git a/test/fixtures/comments/basic/block-trailing-comment/expected.json b/test/fixtures/comments/basic/block-trailing-comment/expected.json old mode 100755 new mode 100644 index f8f5e28599..8a36b86cdf --- a/test/fixtures/comments/basic/block-trailing-comment/expected.json +++ b/test/fixtures/comments/basic/block-trailing-comment/expected.json @@ -83,7 +83,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/comments/basic/comment-within-condition/expected.json b/test/fixtures/comments/basic/comment-within-condition/expected.json old mode 100755 new mode 100644 index 695fa34b10..d98e5b584d --- a/test/fixtures/comments/basic/comment-within-condition/expected.json +++ b/test/fixtures/comments/basic/comment-within-condition/expected.json @@ -54,7 +54,8 @@ "end": { "line": 2, "column": 16 - } + }, + "identifierName": "a" }, "name": "a", "leadingComments": [ diff --git a/test/fixtures/comments/basic/export-default-anonymous-class/expected.json b/test/fixtures/comments/basic/export-default-anonymous-class/expected.json old mode 100755 new mode 100644 index e42c57b979..10e0d6cbdc --- a/test/fixtures/comments/basic/export-default-anonymous-class/expected.json +++ b/test/fixtures/comments/basic/export-default-anonymous-class/expected.json @@ -87,6 +87,7 @@ "column": 5 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -100,16 +101,17 @@ "end": { "line": 8, "column": 11 - } + }, + "identifierName": "method1" }, "name": "method1", "leadingComments": null }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/comments/basic/shebang-import/expected.json b/test/fixtures/comments/basic/shebang-import/expected.json index 3d0e83f874..0a4d4d6663 100644 --- a/test/fixtures/comments/basic/shebang-import/expected.json +++ b/test/fixtures/comments/basic/shebang-import/expected.json @@ -69,9 +69,11 @@ "end": { "line": 3, "column": 13 - } + }, + "identifierName": "spawn" }, - "name": "spawn" + "name": "spawn", + "leadingComments": null }, "local": { "type": "Identifier", @@ -85,10 +87,12 @@ "end": { "line": 3, "column": 13 - } + }, + "identifierName": "spawn" }, "name": "spawn" - } + }, + "leadingComments": null } ], "source": { @@ -151,4 +155,4 @@ } } ] -} +} \ No newline at end of file diff --git a/test/fixtures/comments/basic/shebang-object/expected.json b/test/fixtures/comments/basic/shebang-object/expected.json index 199d8d452a..1d5ab8aced 100644 --- a/test/fixtures/comments/basic/shebang-object/expected.json +++ b/test/fixtures/comments/basic/shebang-object/expected.json @@ -101,9 +101,11 @@ "end": { "line": 3, "column": 11 - } + }, + "identifierName": "spawn" }, - "name": "spawn" + "name": "spawn", + "leadingComments": null }, "value": { "type": "Identifier", @@ -117,15 +119,18 @@ "end": { "line": 3, "column": 11 - } + }, + "identifierName": "spawn" }, "name": "spawn" }, + "leadingComments": null, "extra": { "shorthand": true } } - ] + ], + "leadingComments": null }, "init": { "type": "Identifier", @@ -139,10 +144,12 @@ "end": { "line": 3, "column": 17 - } + }, + "identifierName": "x" }, "name": "x" - } + }, + "leadingComments": null } ], "kind": "var", @@ -186,4 +193,4 @@ } } ] -} +} \ No newline at end of file diff --git a/test/fixtures/comments/basic/surrounding-call-comments/expected.json b/test/fixtures/comments/basic/surrounding-call-comments/expected.json old mode 100755 new mode 100644 index 1b90fb89f0..ea2c84fbc9 --- a/test/fixtures/comments/basic/surrounding-call-comments/expected.json +++ b/test/fixtures/comments/basic/surrounding-call-comments/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,7 +118,8 @@ "end": { "line": 3, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo", "leadingComments": null diff --git a/test/fixtures/comments/basic/surrounding-debugger-comments/expected.json b/test/fixtures/comments/basic/surrounding-debugger-comments/expected.json old mode 100755 new mode 100644 index 76143585ee..f3fc61bd29 --- a/test/fixtures/comments/basic/surrounding-debugger-comments/expected.json +++ b/test/fixtures/comments/basic/surrounding-debugger-comments/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/comments/basic/surrounding-return-comments/expected.json b/test/fixtures/comments/basic/surrounding-return-comments/expected.json old mode 100755 new mode 100644 index 5ce003f2c5..02cf5d12e9 --- a/test/fixtures/comments/basic/surrounding-return-comments/expected.json +++ b/test/fixtures/comments/basic/surrounding-return-comments/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/comments/basic/surrounding-throw-comments/expected.json b/test/fixtures/comments/basic/surrounding-throw-comments/expected.json old mode 100755 new mode 100644 index 5dcfd548ca..c76d573a84 --- a/test/fixtures/comments/basic/surrounding-throw-comments/expected.json +++ b/test/fixtures/comments/basic/surrounding-throw-comments/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/comments/basic/surrounding-while-loop-comments/expected.json b/test/fixtures/comments/basic/surrounding-while-loop-comments/expected.json old mode 100755 new mode 100644 index d2805cc6ab..669d70dc8f --- a/test/fixtures/comments/basic/surrounding-while-loop-comments/expected.json +++ b/test/fixtures/comments/basic/surrounding-while-loop-comments/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -204,7 +206,8 @@ "end": { "line": 1, "column": 65 - } + }, + "identifierName": "each" }, "name": "each", "leadingComments": null diff --git a/test/fixtures/comments/basic/switch-fallthrough-comment-in-function/expected.json b/test/fixtures/comments/basic/switch-fallthrough-comment-in-function/expected.json old mode 100755 new mode 100644 index 4559db028e..3ce051b4a8 --- a/test/fixtures/comments/basic/switch-fallthrough-comment-in-function/expected.json +++ b/test/fixtures/comments/basic/switch-fallthrough-comment-in-function/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "bar" }, "name": "bar" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -119,7 +122,8 @@ "end": { "line": 2, "column": 14 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -252,7 +256,8 @@ "end": { "line": 7, "column": 16 - } + }, + "identifierName": "doIt" }, "name": "doIt" }, diff --git a/test/fixtures/comments/basic/switch-fallthrough-comment/expected.json b/test/fixtures/comments/basic/switch-fallthrough-comment/expected.json old mode 100755 new mode 100644 index 9246cd1331..1e6c9d5796 --- a/test/fixtures/comments/basic/switch-fallthrough-comment/expected.json +++ b/test/fixtures/comments/basic/switch-fallthrough-comment/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -187,7 +188,8 @@ "end": { "line": 6, "column": 12 - } + }, + "identifierName": "doIt" }, "name": "doIt" }, diff --git a/test/fixtures/comments/basic/switch-no-default-comment-in-function/expected.json b/test/fixtures/comments/basic/switch-no-default-comment-in-function/expected.json old mode 100755 new mode 100644 index aa28503c94..ec0792f047 --- a/test/fixtures/comments/basic/switch-no-default-comment-in-function/expected.json +++ b/test/fixtures/comments/basic/switch-no-default-comment-in-function/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "bar" }, "name": "bar" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a" } @@ -119,7 +122,8 @@ "end": { "line": 2, "column": 13 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/expected.json b/test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/expected.json old mode 100755 new mode 100644 index 985d6e376b..2c858e5b45 --- a/test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/expected.json +++ b/test/fixtures/comments/basic/switch-no-default-comment-in-nested-functions/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "module" }, "name": "module" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "exports" }, "name": "exports" }, @@ -122,6 +124,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -135,7 +138,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "context" }, "name": "context" } @@ -181,12 +185,14 @@ "end": { "line": 3, "column": 23 - } + }, + "identifierName": "isConstant" }, "name": "isConstant" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -200,7 +206,8 @@ "end": { "line": 3, "column": 28 - } + }, + "identifierName": "node" }, "name": "node" } @@ -260,7 +267,8 @@ "end": { "line": 4, "column": 20 - } + }, + "identifierName": "node" }, "name": "node" }, @@ -276,7 +284,8 @@ "end": { "line": 4, "column": 25 - } + }, + "identifierName": "type" }, "name": "type" }, @@ -338,7 +347,8 @@ "end": { "line": 6, "column": 33 - } + }, + "identifierName": "isConstant" }, "name": "isConstant" }, @@ -383,7 +393,8 @@ "end": { "line": 6, "column": 38 - } + }, + "identifierName": "node" }, "name": "node" }, @@ -399,7 +410,8 @@ "end": { "line": 6, "column": 50 - } + }, + "identifierName": "expressions" }, "name": "expressions" }, @@ -459,7 +471,8 @@ "end": { "line": 6, "column": 55 - } + }, + "identifierName": "node" }, "name": "node" }, @@ -475,7 +488,8 @@ "end": { "line": 6, "column": 67 - } + }, + "identifierName": "expressions" }, "name": "expressions" }, @@ -493,7 +507,8 @@ "end": { "line": 6, "column": 74 - } + }, + "identifierName": "length" }, "name": "length" }, @@ -631,4 +646,4 @@ } } ] -} +} \ No newline at end of file diff --git a/test/fixtures/comments/basic/switch-no-default-comment/expected.json b/test/fixtures/comments/basic/switch-no-default-comment/expected.json old mode 100755 new mode 100644 index 95efdd480c..99e1057f70 --- a/test/fixtures/comments/basic/switch-no-default-comment/expected.json +++ b/test/fixtures/comments/basic/switch-no-default-comment/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/core/categorized/filename-specified/expected.json b/test/fixtures/core/categorized/filename-specified/expected.json index f48495688b..2269e0729d 100644 --- a/test/fixtures/core/categorized/filename-specified/expected.json +++ b/test/fixtures/core/categorized/filename-specified/expected.json @@ -74,7 +74,8 @@ "line": 2, "column": 8 }, - "filename": "path/to/input-file.js" + "filename": "path/to/input-file.js", + "identifierName": "node" }, "name": "node", "leadingComments": null diff --git a/test/fixtures/core/categorized/not-directive/expected.json b/test/fixtures/core/categorized/not-directive/expected.json index 7e25efd1e5..6f0c685ad2 100644 --- a/test/fixtures/core/categorized/not-directive/expected.json +++ b/test/fixtures/core/categorized/not-directive/expected.json @@ -68,4 +68,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/core/categorized/startline-specified/expected.json b/test/fixtures/core/categorized/startline-specified/expected.json index 52ce62c781..8cd916691c 100644 --- a/test/fixtures/core/categorized/startline-specified/expected.json +++ b/test/fixtures/core/categorized/startline-specified/expected.json @@ -168,292 +168,5 @@ } ], "directives": [] - }, - "comments": [], - "tokens": [ - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "call", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - } - } - }, - { - "type": { - "label": "num", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": 1, - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - } - } - }, - { - "type": { - "label": ";", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "run", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 4 - } - } - }, - { - "type": { - "label": "num", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": 2, - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 6 - } - } - }, - { - "type": { - "label": ";", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 7 - } - } - }, - { - "type": { - "label": "eof", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 16, - "end": 16, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 7 - } - } - } - ] -} + } +} \ No newline at end of file diff --git a/test/fixtures/core/regression/2591/expected.json b/test/fixtures/core/regression/2591/expected.json index f7fa0d0dd4..71e7684f6c 100644 --- a/test/fixtures/core/regression/2591/expected.json +++ b/test/fixtures/core/regression/2591/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,7 +119,8 @@ "end": { "line": 2, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/1/expected.json b/test/fixtures/core/uncategorised/1/expected.json index a60c7436d9..b6bfaa93ed 100644 --- a/test/fixtures/core/uncategorised/1/expected.json +++ b/test/fixtures/core/uncategorised/1/expected.json @@ -58,6 +58,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/10/expected.json b/test/fixtures/core/uncategorised/10/expected.json index 0af5ba3e9c..8b0fba21a9 100644 --- a/test/fixtures/core/uncategorised/10/expected.json +++ b/test/fixtures/core/uncategorised/10/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/102/expected.json b/test/fixtures/core/uncategorised/102/expected.json index 043e944588..1f10ec84f5 100644 --- a/test/fixtures/core/uncategorised/102/expected.json +++ b/test/fixtures/core/uncategorised/102/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/103/expected.json b/test/fixtures/core/uncategorised/103/expected.json index 7e44569209..fcadc76bf1 100644 --- a/test/fixtures/core/uncategorised/103/expected.json +++ b/test/fixtures/core/uncategorised/103/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/104/expected.json b/test/fixtures/core/uncategorised/104/expected.json index caa4a97a89..5deda8be2b 100644 --- a/test/fixtures/core/uncategorised/104/expected.json +++ b/test/fixtures/core/uncategorised/104/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/105/expected.json b/test/fixtures/core/uncategorised/105/expected.json index a6c7677449..d9695a7ebf 100644 --- a/test/fixtures/core/uncategorised/105/expected.json +++ b/test/fixtures/core/uncategorised/105/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/106/expected.json b/test/fixtures/core/uncategorised/106/expected.json index d0ccbfb250..aaae474d9c 100644 --- a/test/fixtures/core/uncategorised/106/expected.json +++ b/test/fixtures/core/uncategorised/106/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/107/expected.json b/test/fixtures/core/uncategorised/107/expected.json index 5eafc662cb..d866871347 100644 --- a/test/fixtures/core/uncategorised/107/expected.json +++ b/test/fixtures/core/uncategorised/107/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/108/expected.json b/test/fixtures/core/uncategorised/108/expected.json index a8e37406e8..83c8e811c9 100644 --- a/test/fixtures/core/uncategorised/108/expected.json +++ b/test/fixtures/core/uncategorised/108/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/109/expected.json b/test/fixtures/core/uncategorised/109/expected.json index 08c175955a..8a400eec78 100644 --- a/test/fixtures/core/uncategorised/109/expected.json +++ b/test/fixtures/core/uncategorised/109/expected.json @@ -68,13 +68,15 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "Button" }, "name": "Button" }, "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/11/expected.json b/test/fixtures/core/uncategorised/11/expected.json index 6cb8b01d29..05a6e4f3d1 100644 --- a/test/fixtures/core/uncategorised/11/expected.json +++ b/test/fixtures/core/uncategorised/11/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/110/expected.json b/test/fixtures/core/uncategorised/110/expected.json index 782d5ea7e4..05c9a2e459 100644 --- a/test/fixtures/core/uncategorised/110/expected.json +++ b/test/fixtures/core/uncategorised/110/expected.json @@ -68,13 +68,15 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "Button" }, "name": "Button" }, "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/111/expected.json b/test/fixtures/core/uncategorised/111/expected.json index 376081c391..42758a1f4e 100644 --- a/test/fixtures/core/uncategorised/111/expected.json +++ b/test/fixtures/core/uncategorised/111/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -91,6 +92,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/112/expected.json b/test/fixtures/core/uncategorised/112/expected.json index 5c476aa6cf..99a0eebd01 100644 --- a/test/fixtures/core/uncategorised/112/expected.json +++ b/test/fixtures/core/uncategorised/112/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -91,6 +92,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/113/expected.json b/test/fixtures/core/uncategorised/113/expected.json index 1b87993df9..b7777dc84a 100644 --- a/test/fixtures/core/uncategorised/113/expected.json +++ b/test/fixtures/core/uncategorised/113/expected.json @@ -96,7 +96,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -123,6 +125,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/114/expected.json b/test/fixtures/core/uncategorised/114/expected.json index 952d418f50..ee47879eca 100644 --- a/test/fixtures/core/uncategorised/114/expected.json +++ b/test/fixtures/core/uncategorised/114/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -107,6 +109,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/115/expected.json b/test/fixtures/core/uncategorised/115/expected.json index 7ace856b56..dc595a854e 100644 --- a/test/fixtures/core/uncategorised/115/expected.json +++ b/test/fixtures/core/uncategorised/115/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -107,6 +109,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/116/expected.json b/test/fixtures/core/uncategorised/116/expected.json index 5e0c9c3c30..36a8e9983d 100644 --- a/test/fixtures/core/uncategorised/116/expected.json +++ b/test/fixtures/core/uncategorised/116/expected.json @@ -96,13 +96,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "foo" }, "name": "foo" }, "arguments": [], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } }, "property": { @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "bar" }, "name": "bar" }, diff --git a/test/fixtures/core/uncategorised/117/expected.json b/test/fixtures/core/uncategorised/117/expected.json index c20918ced6..14abd247cf 100644 --- a/test/fixtures/core/uncategorised/117/expected.json +++ b/test/fixtures/core/uncategorised/117/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -101,13 +103,15 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "baz" }, "name": "baz" } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/118/expected.json b/test/fixtures/core/uncategorised/118/expected.json index 2a92530d73..55989c03bf 100644 --- a/test/fixtures/core/uncategorised/118/expected.json +++ b/test/fixtures/core/uncategorised/118/expected.json @@ -68,11 +68,13 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "foo" }, "name": "foo", "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } }, "arguments": [] diff --git a/test/fixtures/core/uncategorised/119/expected.json b/test/fixtures/core/uncategorised/119/expected.json index 937e364bb2..85def70954 100644 --- a/test/fixtures/core/uncategorised/119/expected.json +++ b/test/fixtures/core/uncategorised/119/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "milkyway" }, "name": "milkyway" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/12/expected.json b/test/fixtures/core/uncategorised/12/expected.json index 5e38d61c9f..b6b96223fa 100644 --- a/test/fixtures/core/uncategorised/12/expected.json +++ b/test/fixtures/core/uncategorised/12/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/120/expected.json b/test/fixtures/core/uncategorised/120/expected.json index 9b9c988c91..9b29fb40a0 100644 --- a/test/fixtures/core/uncategorised/120/expected.json +++ b/test/fixtures/core/uncategorised/120/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "milkyway" }, "name": "milkyway" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "solarsystem" }, "name": "solarsystem" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/121/expected.json b/test/fixtures/core/uncategorised/121/expected.json index e160672e6a..3a03cde9b1 100644 --- a/test/fixtures/core/uncategorised/121/expected.json +++ b/test/fixtures/core/uncategorised/121/expected.json @@ -96,7 +96,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -112,7 +113,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "milkyway" }, "name": "milkyway" }, @@ -130,7 +132,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "solarsystem" }, "name": "solarsystem" }, @@ -148,13 +151,15 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "Earth" }, "name": "Earth" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/122/expected.json b/test/fixtures/core/uncategorised/122/expected.json index 269aad8658..fcc39e4ecc 100644 --- a/test/fixtures/core/uncategorised/122/expected.json +++ b/test/fixtures/core/uncategorised/122/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "galaxyName" }, "name": "galaxyName" }, @@ -115,7 +117,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "otherUselessName" }, "name": "otherUselessName" } @@ -124,6 +127,7 @@ "computed": true } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/123/expected.json b/test/fixtures/core/uncategorised/123/expected.json index fd2ad08336..6a6c95e194 100644 --- a/test/fixtures/core/uncategorised/123/expected.json +++ b/test/fixtures/core/uncategorised/123/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "galaxyName" }, "name": "galaxyName" }, "computed": true } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/124/expected.json b/test/fixtures/core/uncategorised/124/expected.json index ff93859240..7dbf01ef02 100644 --- a/test/fixtures/core/uncategorised/124/expected.json +++ b/test/fixtures/core/uncategorised/124/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "galaxies" }, "name": "galaxies" }, diff --git a/test/fixtures/core/uncategorised/125/expected.json b/test/fixtures/core/uncategorised/125/expected.json index a12ebbfc91..a732436290 100644 --- a/test/fixtures/core/uncategorised/125/expected.json +++ b/test/fixtures/core/uncategorised/125/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -121,7 +122,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "galaxies" }, "name": "galaxies" }, diff --git a/test/fixtures/core/uncategorised/126/expected.json b/test/fixtures/core/uncategorised/126/expected.json index a8ceaa9228..fa67fb5375 100644 --- a/test/fixtures/core/uncategorised/126/expected.json +++ b/test/fixtures/core/uncategorised/126/expected.json @@ -110,7 +110,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -149,7 +150,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "galaxies" }, "name": "galaxies" }, @@ -230,7 +232,8 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "milkyway" }, "name": "milkyway" }, diff --git a/test/fixtures/core/uncategorised/127/expected.json b/test/fixtures/core/uncategorised/127/expected.json index 0286b0ea65..edbf36b172 100644 --- a/test/fixtures/core/uncategorised/127/expected.json +++ b/test/fixtures/core/uncategorised/127/expected.json @@ -110,7 +110,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "earth" }, "name": "earth" }, @@ -126,7 +127,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "asia" }, "name": "asia" }, @@ -144,7 +146,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "Indonesia" }, "name": "Indonesia" }, @@ -162,7 +165,8 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "prepareForElection" }, "name": "prepareForElection" }, diff --git a/test/fixtures/core/uncategorised/128/expected.json b/test/fixtures/core/uncategorised/128/expected.json index 41129f5624..92b467b8e9 100644 --- a/test/fixtures/core/uncategorised/128/expected.json +++ b/test/fixtures/core/uncategorised/128/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "if" }, "name": "if" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/129/expected.json b/test/fixtures/core/uncategorised/129/expected.json index b31bc7542a..43038cf090 100644 --- a/test/fixtures/core/uncategorised/129/expected.json +++ b/test/fixtures/core/uncategorised/129/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "true" }, "name": "true" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/13/expected.json b/test/fixtures/core/uncategorised/13/expected.json index 838c80a0b4..9a01559bd9 100644 --- a/test/fixtures/core/uncategorised/13/expected.json +++ b/test/fixtures/core/uncategorised/13/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/130/expected.json b/test/fixtures/core/uncategorised/130/expected.json index 5bc538a2b9..76fd57dc7a 100644 --- a/test/fixtures/core/uncategorised/130/expected.json +++ b/test/fixtures/core/uncategorised/130/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "false" }, "name": "false" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/131/expected.json b/test/fixtures/core/uncategorised/131/expected.json index a8f3caddc1..1e0fe82f7b 100644 --- a/test/fixtures/core/uncategorised/131/expected.json +++ b/test/fixtures/core/uncategorised/131/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "null" }, "name": "null" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/132/expected.json b/test/fixtures/core/uncategorised/132/expected.json index 0712715b16..6cff980e29 100644 --- a/test/fixtures/core/uncategorised/132/expected.json +++ b/test/fixtures/core/uncategorised/132/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/133/expected.json b/test/fixtures/core/uncategorised/133/expected.json index c4ea608985..b402ef1d3f 100644 --- a/test/fixtures/core/uncategorised/133/expected.json +++ b/test/fixtures/core/uncategorised/133/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/134/expected.json b/test/fixtures/core/uncategorised/134/expected.json index b1909f3acc..4436502a54 100644 --- a/test/fixtures/core/uncategorised/134/expected.json +++ b/test/fixtures/core/uncategorised/134/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "eval" }, "name": "eval" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/135/expected.json b/test/fixtures/core/uncategorised/135/expected.json index aaebc648e7..28309341ef 100644 --- a/test/fixtures/core/uncategorised/135/expected.json +++ b/test/fixtures/core/uncategorised/135/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "eval" }, "name": "eval" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/136/expected.json b/test/fixtures/core/uncategorised/136/expected.json index bb07286fc5..397833c9f4 100644 --- a/test/fixtures/core/uncategorised/136/expected.json +++ b/test/fixtures/core/uncategorised/136/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "arguments" }, "name": "arguments" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/137/expected.json b/test/fixtures/core/uncategorised/137/expected.json index 5fdbf545d2..b27829eedc 100644 --- a/test/fixtures/core/uncategorised/137/expected.json +++ b/test/fixtures/core/uncategorised/137/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "arguments" }, "name": "arguments" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/138/expected.json b/test/fixtures/core/uncategorised/138/expected.json index b8e60e420d..a072a29131 100644 --- a/test/fixtures/core/uncategorised/138/expected.json +++ b/test/fixtures/core/uncategorised/138/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/139/expected.json b/test/fixtures/core/uncategorised/139/expected.json index 74d0f506ec..29f62109f3 100644 --- a/test/fixtures/core/uncategorised/139/expected.json +++ b/test/fixtures/core/uncategorised/139/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/14/expected.json b/test/fixtures/core/uncategorised/14/expected.json index ade504173a..51f1d84750 100644 --- a/test/fixtures/core/uncategorised/14/expected.json +++ b/test/fixtures/core/uncategorised/14/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "日本語" }, "name": "日本語" }, @@ -91,6 +92,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/140/expected.json b/test/fixtures/core/uncategorised/140/expected.json index 892974799e..164c7de5e1 100644 --- a/test/fixtures/core/uncategorised/140/expected.json +++ b/test/fixtures/core/uncategorised/140/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "eval" }, "name": "eval" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/141/expected.json b/test/fixtures/core/uncategorised/141/expected.json index f82908bc2b..e24ebd8ae3 100644 --- a/test/fixtures/core/uncategorised/141/expected.json +++ b/test/fixtures/core/uncategorised/141/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "eval" }, "name": "eval" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/142/expected.json b/test/fixtures/core/uncategorised/142/expected.json index e190c488dd..f8c24a6e5c 100644 --- a/test/fixtures/core/uncategorised/142/expected.json +++ b/test/fixtures/core/uncategorised/142/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "arguments" }, "name": "arguments" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/143/expected.json b/test/fixtures/core/uncategorised/143/expected.json index 8451361753..7c9d3dd0a4 100644 --- a/test/fixtures/core/uncategorised/143/expected.json +++ b/test/fixtures/core/uncategorised/143/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "arguments" }, "name": "arguments" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/144/expected.json b/test/fixtures/core/uncategorised/144/expected.json index 62ee624c4c..8c0aefbb8e 100644 --- a/test/fixtures/core/uncategorised/144/expected.json +++ b/test/fixtures/core/uncategorised/144/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/145/expected.json b/test/fixtures/core/uncategorised/145/expected.json index 4b614da625..d0695f2e20 100644 --- a/test/fixtures/core/uncategorised/145/expected.json +++ b/test/fixtures/core/uncategorised/145/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/146/expected.json b/test/fixtures/core/uncategorised/146/expected.json index 326a3d6c51..900b160cf8 100644 --- a/test/fixtures/core/uncategorised/146/expected.json +++ b/test/fixtures/core/uncategorised/146/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/147/expected.json b/test/fixtures/core/uncategorised/147/expected.json index 5db05c771f..47e35ce89d 100644 --- a/test/fixtures/core/uncategorised/147/expected.json +++ b/test/fixtures/core/uncategorised/147/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/148/expected.json b/test/fixtures/core/uncategorised/148/expected.json index 776ed71df2..9c3d31a745 100644 --- a/test/fixtures/core/uncategorised/148/expected.json +++ b/test/fixtures/core/uncategorised/148/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/149/expected.json b/test/fixtures/core/uncategorised/149/expected.json index f5edc45759..87f98df461 100644 --- a/test/fixtures/core/uncategorised/149/expected.json +++ b/test/fixtures/core/uncategorised/149/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/15/expected.json b/test/fixtures/core/uncategorised/15/expected.json index 81dfb24bee..2699a24ddc 100644 --- a/test/fixtures/core/uncategorised/15/expected.json +++ b/test/fixtures/core/uncategorised/15/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "T‿" }, "name": "T‿" }, @@ -91,6 +92,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/150/expected.json b/test/fixtures/core/uncategorised/150/expected.json index 137dc642bc..644e2e6689 100644 --- a/test/fixtures/core/uncategorised/150/expected.json +++ b/test/fixtures/core/uncategorised/150/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/151/expected.json b/test/fixtures/core/uncategorised/151/expected.json index 89022ede9f..e4544003c4 100644 --- a/test/fixtures/core/uncategorised/151/expected.json +++ b/test/fixtures/core/uncategorised/151/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/152/expected.json b/test/fixtures/core/uncategorised/152/expected.json index 8a860dd890..328a727dec 100644 --- a/test/fixtures/core/uncategorised/152/expected.json +++ b/test/fixtures/core/uncategorised/152/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/153/expected.json b/test/fixtures/core/uncategorised/153/expected.json index 2887a84d0e..ee2eb7b83f 100644 --- a/test/fixtures/core/uncategorised/153/expected.json +++ b/test/fixtures/core/uncategorised/153/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/154/expected.json b/test/fixtures/core/uncategorised/154/expected.json index 951a2c8573..4f4281d12b 100644 --- a/test/fixtures/core/uncategorised/154/expected.json +++ b/test/fixtures/core/uncategorised/154/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/155/expected.json b/test/fixtures/core/uncategorised/155/expected.json index 4be8cd12bf..e715c38ccb 100644 --- a/test/fixtures/core/uncategorised/155/expected.json +++ b/test/fixtures/core/uncategorised/155/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/156/expected.json b/test/fixtures/core/uncategorised/156/expected.json index 7da984159e..1d480a3e1a 100644 --- a/test/fixtures/core/uncategorised/156/expected.json +++ b/test/fixtures/core/uncategorised/156/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/157/expected.json b/test/fixtures/core/uncategorised/157/expected.json index 51b1fefd9e..80210cee23 100644 --- a/test/fixtures/core/uncategorised/157/expected.json +++ b/test/fixtures/core/uncategorised/157/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/158/expected.json b/test/fixtures/core/uncategorised/158/expected.json index c61c63d02d..5edfbca9c7 100644 --- a/test/fixtures/core/uncategorised/158/expected.json +++ b/test/fixtures/core/uncategorised/158/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/159/expected.json b/test/fixtures/core/uncategorised/159/expected.json index da2300c3ba..39ed4b1c81 100644 --- a/test/fixtures/core/uncategorised/159/expected.json +++ b/test/fixtures/core/uncategorised/159/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/16/expected.json b/test/fixtures/core/uncategorised/16/expected.json index 5a6cd38868..0f87b255d7 100644 --- a/test/fixtures/core/uncategorised/16/expected.json +++ b/test/fixtures/core/uncategorised/16/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "T‌" }, "name": "T‌" }, @@ -91,6 +92,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/160/expected.json b/test/fixtures/core/uncategorised/160/expected.json index d036898e8d..edbe85495e 100644 --- a/test/fixtures/core/uncategorised/160/expected.json +++ b/test/fixtures/core/uncategorised/160/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/161/expected.json b/test/fixtures/core/uncategorised/161/expected.json index 21272df967..f4fd2421d9 100644 --- a/test/fixtures/core/uncategorised/161/expected.json +++ b/test/fixtures/core/uncategorised/161/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/162/expected.json b/test/fixtures/core/uncategorised/162/expected.json index 4eba25fa96..fab9884151 100644 --- a/test/fixtures/core/uncategorised/162/expected.json +++ b/test/fixtures/core/uncategorised/162/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/163/expected.json b/test/fixtures/core/uncategorised/163/expected.json index 179ec5032f..09804a0b7c 100644 --- a/test/fixtures/core/uncategorised/163/expected.json +++ b/test/fixtures/core/uncategorised/163/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/164/expected.json b/test/fixtures/core/uncategorised/164/expected.json index 8edd71168c..992fb876e2 100644 --- a/test/fixtures/core/uncategorised/164/expected.json +++ b/test/fixtures/core/uncategorised/164/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/165/expected.json b/test/fixtures/core/uncategorised/165/expected.json index 855baa45d7..39e74f7d29 100644 --- a/test/fixtures/core/uncategorised/165/expected.json +++ b/test/fixtures/core/uncategorised/165/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/166/expected.json b/test/fixtures/core/uncategorised/166/expected.json index c1e5bf26af..582e04e0dc 100644 --- a/test/fixtures/core/uncategorised/166/expected.json +++ b/test/fixtures/core/uncategorised/166/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/167/expected.json b/test/fixtures/core/uncategorised/167/expected.json index 8eb45e6a10..507ec12519 100644 --- a/test/fixtures/core/uncategorised/167/expected.json +++ b/test/fixtures/core/uncategorised/167/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/168/expected.json b/test/fixtures/core/uncategorised/168/expected.json index 2610f3986a..aada50d79c 100644 --- a/test/fixtures/core/uncategorised/168/expected.json +++ b/test/fixtures/core/uncategorised/168/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/169/expected.json b/test/fixtures/core/uncategorised/169/expected.json index ab3b9424ab..a22ceaea6a 100644 --- a/test/fixtures/core/uncategorised/169/expected.json +++ b/test/fixtures/core/uncategorised/169/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/17/expected.json b/test/fixtures/core/uncategorised/17/expected.json index 2fbb41c2a6..26bc8c13c9 100644 --- a/test/fixtures/core/uncategorised/17/expected.json +++ b/test/fixtures/core/uncategorised/17/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "T‍" }, "name": "T‍" }, @@ -91,6 +92,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/170/expected.json b/test/fixtures/core/uncategorised/170/expected.json index a21f7900f7..a479164a06 100644 --- a/test/fixtures/core/uncategorised/170/expected.json +++ b/test/fixtures/core/uncategorised/170/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/171/expected.json b/test/fixtures/core/uncategorised/171/expected.json index 9ff129d06b..e22094073c 100644 --- a/test/fixtures/core/uncategorised/171/expected.json +++ b/test/fixtures/core/uncategorised/171/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/172/expected.json b/test/fixtures/core/uncategorised/172/expected.json index 2c6c6a71aa..7cd159ef07 100644 --- a/test/fixtures/core/uncategorised/172/expected.json +++ b/test/fixtures/core/uncategorised/172/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/173/expected.json b/test/fixtures/core/uncategorised/173/expected.json index 102f5d3d69..8d5866efa2 100644 --- a/test/fixtures/core/uncategorised/173/expected.json +++ b/test/fixtures/core/uncategorised/173/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/174/expected.json b/test/fixtures/core/uncategorised/174/expected.json index de56597e6a..bcc48922f6 100644 --- a/test/fixtures/core/uncategorised/174/expected.json +++ b/test/fixtures/core/uncategorised/174/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/175/expected.json b/test/fixtures/core/uncategorised/175/expected.json index edc0351968..d4924593c3 100644 --- a/test/fixtures/core/uncategorised/175/expected.json +++ b/test/fixtures/core/uncategorised/175/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/176/expected.json b/test/fixtures/core/uncategorised/176/expected.json index 74e0ab65b8..3b53c28f8f 100644 --- a/test/fixtures/core/uncategorised/176/expected.json +++ b/test/fixtures/core/uncategorised/176/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/177/expected.json b/test/fixtures/core/uncategorised/177/expected.json index 510073e483..3eab6d0286 100644 --- a/test/fixtures/core/uncategorised/177/expected.json +++ b/test/fixtures/core/uncategorised/177/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/178/expected.json b/test/fixtures/core/uncategorised/178/expected.json index 5e5fca2313..e929279a89 100644 --- a/test/fixtures/core/uncategorised/178/expected.json +++ b/test/fixtures/core/uncategorised/178/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/179/expected.json b/test/fixtures/core/uncategorised/179/expected.json index dc0ac6b9bf..e0124c982f 100644 --- a/test/fixtures/core/uncategorised/179/expected.json +++ b/test/fixtures/core/uncategorised/179/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/18/expected.json b/test/fixtures/core/uncategorised/18/expected.json index 86195734f1..3e3a06842f 100644 --- a/test/fixtures/core/uncategorised/18/expected.json +++ b/test/fixtures/core/uncategorised/18/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "ⅣⅡ" }, "name": "ⅣⅡ" }, @@ -91,6 +92,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/180/expected.json b/test/fixtures/core/uncategorised/180/expected.json index 4beef8dd3d..d891a4741e 100644 --- a/test/fixtures/core/uncategorised/180/expected.json +++ b/test/fixtures/core/uncategorised/180/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/181/expected.json b/test/fixtures/core/uncategorised/181/expected.json index 9d743b0d39..07dfb3ff15 100644 --- a/test/fixtures/core/uncategorised/181/expected.json +++ b/test/fixtures/core/uncategorised/181/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/182/expected.json b/test/fixtures/core/uncategorised/182/expected.json index 3e5a22a223..a251fd60d7 100644 --- a/test/fixtures/core/uncategorised/182/expected.json +++ b/test/fixtures/core/uncategorised/182/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/183/expected.json b/test/fixtures/core/uncategorised/183/expected.json index 2174559e10..63a295482e 100644 --- a/test/fixtures/core/uncategorised/183/expected.json +++ b/test/fixtures/core/uncategorised/183/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/184/expected.json b/test/fixtures/core/uncategorised/184/expected.json index 92c65557e6..8384ff1b91 100644 --- a/test/fixtures/core/uncategorised/184/expected.json +++ b/test/fixtures/core/uncategorised/184/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/185/expected.json b/test/fixtures/core/uncategorised/185/expected.json index 188c481bfc..11335ea1d3 100644 --- a/test/fixtures/core/uncategorised/185/expected.json +++ b/test/fixtures/core/uncategorised/185/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/186/expected.json b/test/fixtures/core/uncategorised/186/expected.json index 3c6c2f0817..1cfab365e3 100644 --- a/test/fixtures/core/uncategorised/186/expected.json +++ b/test/fixtures/core/uncategorised/186/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/187/expected.json b/test/fixtures/core/uncategorised/187/expected.json index 48e47e4198..e819fc3506 100644 --- a/test/fixtures/core/uncategorised/187/expected.json +++ b/test/fixtures/core/uncategorised/187/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/188/expected.json b/test/fixtures/core/uncategorised/188/expected.json index 0fa66acc0b..f14d54ace0 100644 --- a/test/fixtures/core/uncategorised/188/expected.json +++ b/test/fixtures/core/uncategorised/188/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/189/expected.json b/test/fixtures/core/uncategorised/189/expected.json index c8df10d3d8..481b96d976 100644 --- a/test/fixtures/core/uncategorised/189/expected.json +++ b/test/fixtures/core/uncategorised/189/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/19/expected.json b/test/fixtures/core/uncategorised/19/expected.json index 86195734f1..3e3a06842f 100644 --- a/test/fixtures/core/uncategorised/19/expected.json +++ b/test/fixtures/core/uncategorised/19/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "ⅣⅡ" }, "name": "ⅣⅡ" }, @@ -91,6 +92,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/190/expected.json b/test/fixtures/core/uncategorised/190/expected.json index c66d330503..ff26c296d7 100644 --- a/test/fixtures/core/uncategorised/190/expected.json +++ b/test/fixtures/core/uncategorised/190/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/191/expected.json b/test/fixtures/core/uncategorised/191/expected.json index 43821da431..3dbff25ba9 100644 --- a/test/fixtures/core/uncategorised/191/expected.json +++ b/test/fixtures/core/uncategorised/191/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/192/expected.json b/test/fixtures/core/uncategorised/192/expected.json index 7b3dce0fdb..b4327fea4a 100644 --- a/test/fixtures/core/uncategorised/192/expected.json +++ b/test/fixtures/core/uncategorised/192/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/193/expected.json b/test/fixtures/core/uncategorised/193/expected.json index 313205c734..3e277f2fb0 100644 --- a/test/fixtures/core/uncategorised/193/expected.json +++ b/test/fixtures/core/uncategorised/193/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/194/expected.json b/test/fixtures/core/uncategorised/194/expected.json index 076e9826f5..759ef90eeb 100644 --- a/test/fixtures/core/uncategorised/194/expected.json +++ b/test/fixtures/core/uncategorised/194/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/195/expected.json b/test/fixtures/core/uncategorised/195/expected.json index 39a92de27e..51c2a9cc9c 100644 --- a/test/fixtures/core/uncategorised/195/expected.json +++ b/test/fixtures/core/uncategorised/195/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/196/expected.json b/test/fixtures/core/uncategorised/196/expected.json index 27399a9c53..663534b1b4 100644 --- a/test/fixtures/core/uncategorised/196/expected.json +++ b/test/fixtures/core/uncategorised/196/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/197/expected.json b/test/fixtures/core/uncategorised/197/expected.json index 11b669b4ea..ca2df57148 100644 --- a/test/fixtures/core/uncategorised/197/expected.json +++ b/test/fixtures/core/uncategorised/197/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "y" }, "name": "y" }, diff --git a/test/fixtures/core/uncategorised/198/expected.json b/test/fixtures/core/uncategorised/198/expected.json index 32682fb46d..7ec28110ed 100644 --- a/test/fixtures/core/uncategorised/198/expected.json +++ b/test/fixtures/core/uncategorised/198/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/core/uncategorised/199/expected.json b/test/fixtures/core/uncategorised/199/expected.json index 712d4fd6c1..0f7d218b48 100644 --- a/test/fixtures/core/uncategorised/199/expected.json +++ b/test/fixtures/core/uncategorised/199/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/2/expected.json b/test/fixtures/core/uncategorised/2/expected.json index 9ca3c11021..bdfeb76fd1 100644 --- a/test/fixtures/core/uncategorised/2/expected.json +++ b/test/fixtures/core/uncategorised/2/expected.json @@ -58,6 +58,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/20/expected.json b/test/fixtures/core/uncategorised/20/expected.json index fcc6f37efa..7634638322 100644 --- a/test/fixtures/core/uncategorised/20/expected.json +++ b/test/fixtures/core/uncategorised/20/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -91,6 +92,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/200/expected.json b/test/fixtures/core/uncategorised/200/expected.json index 01bf6f0d71..08e10f09be 100644 --- a/test/fixtures/core/uncategorised/200/expected.json +++ b/test/fixtures/core/uncategorised/200/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "eval" }, "name": "eval" }, diff --git a/test/fixtures/core/uncategorised/201/expected.json b/test/fixtures/core/uncategorised/201/expected.json index 691796ca2f..588a74e579 100644 --- a/test/fixtures/core/uncategorised/201/expected.json +++ b/test/fixtures/core/uncategorised/201/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, diff --git a/test/fixtures/core/uncategorised/202/expected.json b/test/fixtures/core/uncategorised/202/expected.json index 4a01dfd629..3a99ca3eb6 100644 --- a/test/fixtures/core/uncategorised/202/expected.json +++ b/test/fixtures/core/uncategorised/202/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/203/expected.json b/test/fixtures/core/uncategorised/203/expected.json index 1382a9b238..ec473b3207 100644 --- a/test/fixtures/core/uncategorised/203/expected.json +++ b/test/fixtures/core/uncategorised/203/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/204/expected.json b/test/fixtures/core/uncategorised/204/expected.json index e2a6524e00..812fb07cc1 100644 --- a/test/fixtures/core/uncategorised/204/expected.json +++ b/test/fixtures/core/uncategorised/204/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/205/expected.json b/test/fixtures/core/uncategorised/205/expected.json index 3fb8e6a109..4d6b358971 100644 --- a/test/fixtures/core/uncategorised/205/expected.json +++ b/test/fixtures/core/uncategorised/205/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/206/expected.json b/test/fixtures/core/uncategorised/206/expected.json index 8b681331b0..26b624a7d4 100644 --- a/test/fixtures/core/uncategorised/206/expected.json +++ b/test/fixtures/core/uncategorised/206/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/207/expected.json b/test/fixtures/core/uncategorised/207/expected.json index 827b99dbe0..441330c54c 100644 --- a/test/fixtures/core/uncategorised/207/expected.json +++ b/test/fixtures/core/uncategorised/207/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/208/expected.json b/test/fixtures/core/uncategorised/208/expected.json index d27aeea8cc..1d99f52655 100644 --- a/test/fixtures/core/uncategorised/208/expected.json +++ b/test/fixtures/core/uncategorised/208/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/209/expected.json b/test/fixtures/core/uncategorised/209/expected.json index ea2c4e00ff..10665e9e41 100644 --- a/test/fixtures/core/uncategorised/209/expected.json +++ b/test/fixtures/core/uncategorised/209/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/21/expected.json b/test/fixtures/core/uncategorised/21/expected.json index ed3af08e0b..53768b945f 100644 --- a/test/fixtures/core/uncategorised/21/expected.json +++ b/test/fixtures/core/uncategorised/21/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -91,6 +92,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/210/expected.json b/test/fixtures/core/uncategorised/210/expected.json index 12db3bd78f..ffab2697d0 100644 --- a/test/fixtures/core/uncategorised/210/expected.json +++ b/test/fixtures/core/uncategorised/210/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/211/expected.json b/test/fixtures/core/uncategorised/211/expected.json index 2b34e74553..a4a9088d93 100644 --- a/test/fixtures/core/uncategorised/211/expected.json +++ b/test/fixtures/core/uncategorised/211/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/212/expected.json b/test/fixtures/core/uncategorised/212/expected.json index ef886d2c97..173d746401 100644 --- a/test/fixtures/core/uncategorised/212/expected.json +++ b/test/fixtures/core/uncategorised/212/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/213/expected.json b/test/fixtures/core/uncategorised/213/expected.json index 5d5053da91..ca5a5fb0eb 100644 --- a/test/fixtures/core/uncategorised/213/expected.json +++ b/test/fixtures/core/uncategorised/213/expected.json @@ -69,13 +69,16 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "foo" }, "name": "foo" } } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/214/expected.json b/test/fixtures/core/uncategorised/214/expected.json index eec6775871..b271f0a04c 100644 --- a/test/fixtures/core/uncategorised/214/expected.json +++ b/test/fixtures/core/uncategorised/214/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "doThis" }, "name": "doThis" }, @@ -130,15 +131,18 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "doThat" }, "name": "doThat" }, "arguments": [] } } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/215/expected.json b/test/fixtures/core/uncategorised/215/expected.json index 5792211240..d209b58703 100644 --- a/test/fixtures/core/uncategorised/215/expected.json +++ b/test/fixtures/core/uncategorised/215/expected.json @@ -42,8 +42,10 @@ "column": 2 } }, - "body": [] + "body": [], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/216/expected.json b/test/fixtures/core/uncategorised/216/expected.json index ec2dadfcf0..2dc156600a 100644 --- a/test/fixtures/core/uncategorised/216/expected.json +++ b/test/fixtures/core/uncategorised/216/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/217/expected.json b/test/fixtures/core/uncategorised/217/expected.json index 4ed5077fe0..efb47e7394 100644 --- a/test/fixtures/core/uncategorised/217/expected.json +++ b/test/fixtures/core/uncategorised/217/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -101,7 +102,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -110,6 +112,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/218/expected.json b/test/fixtures/core/uncategorised/218/expected.json index fceb7088d9..8515e2fd31 100644 --- a/test/fixtures/core/uncategorised/218/expected.json +++ b/test/fixtures/core/uncategorised/218/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/219/expected.json b/test/fixtures/core/uncategorised/219/expected.json index 0937c1b68d..c43470cfea 100644 --- a/test/fixtures/core/uncategorised/219/expected.json +++ b/test/fixtures/core/uncategorised/219/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "eval" }, "name": "eval" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, diff --git a/test/fixtures/core/uncategorised/22/expected.json b/test/fixtures/core/uncategorised/22/expected.json index 87f4913585..bc44d62df8 100644 --- a/test/fixtures/core/uncategorised/22/expected.json +++ b/test/fixtures/core/uncategorised/22/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "answer" }, "name": "answer" }, diff --git a/test/fixtures/core/uncategorised/220/expected.json b/test/fixtures/core/uncategorised/220/expected.json index 4c14f501ea..880833c662 100644 --- a/test/fixtures/core/uncategorised/220/expected.json +++ b/test/fixtures/core/uncategorised/220/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -171,7 +173,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "z" }, "name": "z" }, diff --git a/test/fixtures/core/uncategorised/221/expected.json b/test/fixtures/core/uncategorised/221/expected.json index 17a5559327..3b4811d947 100644 --- a/test/fixtures/core/uncategorised/221/expected.json +++ b/test/fixtures/core/uncategorised/221/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "implements" }, "name": "implements" }, @@ -101,7 +102,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "interface" }, "name": "interface" }, @@ -133,7 +135,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "package" }, "name": "package" }, @@ -142,6 +145,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/222/expected.json b/test/fixtures/core/uncategorised/222/expected.json index 8744560249..1afee34c9e 100644 --- a/test/fixtures/core/uncategorised/222/expected.json +++ b/test/fixtures/core/uncategorised/222/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "private" }, "name": "private" }, @@ -101,7 +102,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "protected" }, "name": "protected" }, @@ -133,7 +135,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "public" }, "name": "public" }, @@ -165,7 +168,8 @@ "end": { "line": 1, "column": 38 - } + }, + "identifierName": "static" }, "name": "static" }, @@ -174,6 +178,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/223/expected.json b/test/fixtures/core/uncategorised/223/expected.json index d76894f1aa..e48902c158 100644 --- a/test/fixtures/core/uncategorised/223/expected.json +++ b/test/fixtures/core/uncategorised/223/expected.json @@ -43,6 +43,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/224/expected.json b/test/fixtures/core/uncategorised/224/expected.json index 470ad995ab..7d660bdda7 100644 --- a/test/fixtures/core/uncategorised/224/expected.json +++ b/test/fixtures/core/uncategorised/224/expected.json @@ -54,11 +54,13 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/225/expected.json b/test/fixtures/core/uncategorised/225/expected.json index a1f0e67018..a8a40d3c2b 100644 --- a/test/fixtures/core/uncategorised/225/expected.json +++ b/test/fixtures/core/uncategorised/225/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,13 +86,15 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "y" }, "name": "y" } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/226/expected.json b/test/fixtures/core/uncategorised/226/expected.json index afc7d69fc3..f144d42ff4 100644 --- a/test/fixtures/core/uncategorised/226/expected.json +++ b/test/fixtures/core/uncategorised/226/expected.json @@ -54,11 +54,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/227/expected.json b/test/fixtures/core/uncategorised/227/expected.json index 2f6ae75852..69f5646954 100644 --- a/test/fixtures/core/uncategorised/227/expected.json +++ b/test/fixtures/core/uncategorised/227/expected.json @@ -54,11 +54,13 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "aa" }, "name": "aa" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/228/expected.json b/test/fixtures/core/uncategorised/228/expected.json index 61f0887961..18f37a7b65 100644 --- a/test/fixtures/core/uncategorised/228/expected.json +++ b/test/fixtures/core/uncategorised/228/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "morning" }, "name": "morning" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "goodMorning" }, "name": "goodMorning" }, @@ -107,6 +109,7 @@ }, "alternate": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/229/expected.json b/test/fixtures/core/uncategorised/229/expected.json index 640c5691c2..38198e3d25 100644 --- a/test/fixtures/core/uncategorised/229/expected.json +++ b/test/fixtures/core/uncategorised/229/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "morning" }, "name": "morning" }, @@ -89,6 +90,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -108,7 +110,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 13 } } }, diff --git a/test/fixtures/core/uncategorised/23/expected.json b/test/fixtures/core/uncategorised/23/expected.json index fa3c158b8a..8373348ba7 100644 --- a/test/fixtures/core/uncategorised/23/expected.json +++ b/test/fixtures/core/uncategorised/23/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "if" }, "name": "if" }, diff --git a/test/fixtures/core/uncategorised/230/expected.json b/test/fixtures/core/uncategorised/230/expected.json index bf2044c42a..492f0ac62c 100644 --- a/test/fixtures/core/uncategorised/230/expected.json +++ b/test/fixtures/core/uncategorised/230/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "morning" }, "name": "morning" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/231/expected.json b/test/fixtures/core/uncategorised/231/expected.json index 720f53798d..453c4e700d 100644 --- a/test/fixtures/core/uncategorised/231/expected.json +++ b/test/fixtures/core/uncategorised/231/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "morning" }, "name": "morning" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "goodMorning" }, "name": "goodMorning" }, @@ -145,7 +147,8 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "goodDay" }, "name": "goodDay" }, @@ -153,6 +156,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/232/expected.json b/test/fixtures/core/uncategorised/232/expected.json index 52f64a4d6b..6b99345c09 100644 --- a/test/fixtures/core/uncategorised/232/expected.json +++ b/test/fixtures/core/uncategorised/232/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "keep" }, "name": "keep" }, diff --git a/test/fixtures/core/uncategorised/233/expected.json b/test/fixtures/core/uncategorised/233/expected.json index 04998adb58..a131703fce 100644 --- a/test/fixtures/core/uncategorised/233/expected.json +++ b/test/fixtures/core/uncategorised/233/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "keep" }, "name": "keep" }, diff --git a/test/fixtures/core/uncategorised/234/expected.json b/test/fixtures/core/uncategorised/234/expected.json index 9814bc6039..e2f50113d3 100644 --- a/test/fixtures/core/uncategorised/234/expected.json +++ b/test/fixtures/core/uncategorised/234/expected.json @@ -99,7 +99,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" } @@ -147,7 +148,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "y" }, "name": "y" } @@ -182,7 +184,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/236/expected.json b/test/fixtures/core/uncategorised/236/expected.json index b154f386f7..1cd371f080 100644 --- a/test/fixtures/core/uncategorised/236/expected.json +++ b/test/fixtures/core/uncategorised/236/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "doSomething" }, "name": "doSomething" }, diff --git a/test/fixtures/core/uncategorised/237/expected.json b/test/fixtures/core/uncategorised/237/expected.json index 8ca1322823..f08d3a9485 100644 --- a/test/fixtures/core/uncategorised/237/expected.json +++ b/test/fixtures/core/uncategorised/237/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -151,7 +152,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "x" }, "name": "x" } @@ -199,7 +201,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/core/uncategorised/238/expected.json b/test/fixtures/core/uncategorised/238/expected.json index 9474ed02f5..5f4998d8a0 100644 --- a/test/fixtures/core/uncategorised/238/expected.json +++ b/test/fixtures/core/uncategorised/238/expected.json @@ -61,6 +61,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/239/expected.json b/test/fixtures/core/uncategorised/239/expected.json index ee4511c5df..67a281d20e 100644 --- a/test/fixtures/core/uncategorised/239/expected.json +++ b/test/fixtures/core/uncategorised/239/expected.json @@ -59,9 +59,11 @@ "column": 9 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/24/expected.json b/test/fixtures/core/uncategorised/24/expected.json index e332b892cc..723c8db2a5 100644 --- a/test/fixtures/core/uncategorised/24/expected.json +++ b/test/fixtures/core/uncategorised/24/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "true" }, "name": "true" }, diff --git a/test/fixtures/core/uncategorised/240/expected.json b/test/fixtures/core/uncategorised/240/expected.json index 96e6163073..ac885ace49 100644 --- a/test/fixtures/core/uncategorised/240/expected.json +++ b/test/fixtures/core/uncategorised/240/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/241/expected.json b/test/fixtures/core/uncategorised/241/expected.json index 06e23e5726..424fedd8b8 100644 --- a/test/fixtures/core/uncategorised/241/expected.json +++ b/test/fixtures/core/uncategorised/241/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/242/expected.json b/test/fixtures/core/uncategorised/242/expected.json index 9703da41dc..f701a8cc20 100644 --- a/test/fixtures/core/uncategorised/242/expected.json +++ b/test/fixtures/core/uncategorised/242/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "y" }, "name": "y" }, diff --git a/test/fixtures/core/uncategorised/243/expected.json b/test/fixtures/core/uncategorised/243/expected.json index 799bca6bd8..019c93da93 100644 --- a/test/fixtures/core/uncategorised/243/expected.json +++ b/test/fixtures/core/uncategorised/243/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/244/expected.json b/test/fixtures/core/uncategorised/244/expected.json index bab630bd14..d44ae9616d 100644 --- a/test/fixtures/core/uncategorised/244/expected.json +++ b/test/fixtures/core/uncategorised/244/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -174,7 +176,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "x" }, "name": "x" } diff --git a/test/fixtures/core/uncategorised/245/expected.json b/test/fixtures/core/uncategorised/245/expected.json index 88e0fa1c9f..bd932cf468 100644 --- a/test/fixtures/core/uncategorised/245/expected.json +++ b/test/fixtures/core/uncategorised/245/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -174,7 +176,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "x" }, "name": "x" } @@ -219,7 +222,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -236,7 +240,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "x" }, "name": "x" } diff --git a/test/fixtures/core/uncategorised/246/expected.json b/test/fixtures/core/uncategorised/246/expected.json index f95b2f15a7..9c7cdebe0f 100644 --- a/test/fixtures/core/uncategorised/246/expected.json +++ b/test/fixtures/core/uncategorised/246/expected.json @@ -42,6 +42,7 @@ "column": 26 } }, + "await": false, "left": { "type": "Identifier", "start": 4, @@ -54,7 +55,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -70,7 +72,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -114,7 +117,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -131,7 +135,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "x" }, "name": "x" } @@ -139,6 +144,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/247/expected.json b/test/fixtures/core/uncategorised/247/expected.json index 50d29b5d32..4a3a0ecfda 100644 --- a/test/fixtures/core/uncategorised/247/expected.json +++ b/test/fixtures/core/uncategorised/247/expected.json @@ -42,6 +42,7 @@ "column": 31 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -148,7 +151,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -165,7 +169,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "x" }, "name": "x" } @@ -173,6 +178,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/25/expected.json b/test/fixtures/core/uncategorised/25/expected.json index dbe5f3ef0b..1245b12ad3 100644 --- a/test/fixtures/core/uncategorised/25/expected.json +++ b/test/fixtures/core/uncategorised/25/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "false" }, "name": "false" }, diff --git a/test/fixtures/core/uncategorised/252/expected.json b/test/fixtures/core/uncategorised/252/expected.json index 3d3611769c..7b69d3e398 100644 --- a/test/fixtures/core/uncategorised/252/expected.json +++ b/test/fixtures/core/uncategorised/252/expected.json @@ -113,7 +113,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "done" }, "name": "done" } @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "done" }, "name": "done" } diff --git a/test/fixtures/core/uncategorised/253/expected.json b/test/fixtures/core/uncategorised/253/expected.json index e2eede95cf..73a3847e0b 100644 --- a/test/fixtures/core/uncategorised/253/expected.json +++ b/test/fixtures/core/uncategorised/253/expected.json @@ -113,7 +113,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "done" }, "name": "done" } @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "done" }, "name": "done" } diff --git a/test/fixtures/core/uncategorised/255/expected.json b/test/fixtures/core/uncategorised/255/expected.json index 930203bdfe..b46b8cecc6 100644 --- a/test/fixtures/core/uncategorised/255/expected.json +++ b/test/fixtures/core/uncategorised/255/expected.json @@ -113,7 +113,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "done" }, "name": "done" } @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "done" }, "name": "done" } diff --git a/test/fixtures/core/uncategorised/256/expected.json b/test/fixtures/core/uncategorised/256/expected.json index 207d4cf4c5..75ce4af774 100644 --- a/test/fixtures/core/uncategorised/256/expected.json +++ b/test/fixtures/core/uncategorised/256/expected.json @@ -113,7 +113,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "done" }, "name": "done" } @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "done" }, "name": "done" } diff --git a/test/fixtures/core/uncategorised/257/expected.json b/test/fixtures/core/uncategorised/257/expected.json index 9e26dfeeb6..31e7290e5c 100644 --- a/test/fixtures/core/uncategorised/257/expected.json +++ b/test/fixtures/core/uncategorised/257/expected.json @@ -1 +1,179 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "body": { + "type": "LabeledStatement", + "start": 9, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "body": { + "type": "WhileStatement", + "start": 18, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 25, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 31, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 33, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "label": { + "type": "Identifier", + "start": 42, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 49 + }, + "identifierName": "target1" + }, + "name": "target1" + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "target2" + }, + "name": "target2" + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "target1" + }, + "name": "target1" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/258/expected.json b/test/fixtures/core/uncategorised/258/expected.json index 9e26dfeeb6..b806d609b1 100644 --- a/test/fixtures/core/uncategorised/258/expected.json +++ b/test/fixtures/core/uncategorised/258/expected.json @@ -1 +1,211 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "sourceType": "script", + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "body": { + "type": "LabeledStatement", + "start": 9, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "body": { + "type": "LabeledStatement", + "start": 18, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "body": { + "type": "WhileStatement", + "start": 27, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 34, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 40, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 42, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "label": { + "type": "Identifier", + "start": 51, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 58 + }, + "identifierName": "target1" + }, + "name": "target1" + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "target3" + }, + "name": "target3" + } + }, + "label": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "target2" + }, + "name": "target2" + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "target1" + }, + "name": "target1" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/259/expected.json b/test/fixtures/core/uncategorised/259/expected.json index 3811851cf2..fe9666a99e 100644 --- a/test/fixtures/core/uncategorised/259/expected.json +++ b/test/fixtures/core/uncategorised/259/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -95,7 +96,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/26/expected.json b/test/fixtures/core/uncategorised/26/expected.json index 88e109fbf9..17acbb207e 100644 --- a/test/fixtures/core/uncategorised/26/expected.json +++ b/test/fixtures/core/uncategorised/26/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "null" }, "name": "null" }, diff --git a/test/fixtures/core/uncategorised/260/expected.json b/test/fixtures/core/uncategorised/260/expected.json index cfc30f8e34..1f4ff8a16a 100644 --- a/test/fixtures/core/uncategorised/260/expected.json +++ b/test/fixtures/core/uncategorised/260/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -95,7 +96,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/261/expected.json b/test/fixtures/core/uncategorised/261/expected.json index 7e253235fc..05b71f8cff 100644 --- a/test/fixtures/core/uncategorised/261/expected.json +++ b/test/fixtures/core/uncategorised/261/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -101,7 +102,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "x" }, "name": "x" } @@ -110,7 +112,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/262/expected.json b/test/fixtures/core/uncategorised/262/expected.json index d4f71c39ad..bd73928291 100644 --- a/test/fixtures/core/uncategorised/262/expected.json +++ b/test/fixtures/core/uncategorised/262/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -132,7 +134,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "y" }, "name": "y" } @@ -142,7 +145,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/263/expected.json b/test/fixtures/core/uncategorised/263/expected.json index 9e26dfeeb6..88cf010a10 100644 --- a/test/fixtures/core/uncategorised/263/expected.json +++ b/test/fixtures/core/uncategorised/263/expected.json @@ -1 +1,167 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WithStatement", + "start": 17, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "object": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "x" + }, + "name": "x" + }, + "body": { + "type": "ExpressionStatement", + "start": 26, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "right": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": "use\\x20strict", + "extra": { + "raw": "'use\\x20strict'", + "rawValue": "use\\x20strict" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/264/expected.json b/test/fixtures/core/uncategorised/264/expected.json index 9e26dfeeb6..43dab0dc7a 100644 --- a/test/fixtures/core/uncategorised/264/expected.json +++ b/test/fixtures/core/uncategorised/264/expected.json @@ -1 +1,167 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WithStatement", + "start": 17, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "object": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "x" + }, + "name": "x" + }, + "body": { + "type": "ExpressionStatement", + "start": 26, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "right": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": "use\\x20strict", + "extra": { + "raw": "\"use\\x20strict\"", + "rawValue": "use\\x20strict" + } + } + } + ] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/265/expected.json b/test/fixtures/core/uncategorised/265/expected.json index f4e3da9d15..c1ca938f16 100644 --- a/test/fixtures/core/uncategorised/265/expected.json +++ b/test/fixtures/core/uncategorised/265/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -115,13 +117,15 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "bar" }, "name": "bar" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/266/expected.json b/test/fixtures/core/uncategorised/266/expected.json index 9e895a7f45..bca8b9d7da 100644 --- a/test/fixtures/core/uncategorised/266/expected.json +++ b/test/fixtures/core/uncategorised/266/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -115,13 +117,15 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "bar" }, "name": "bar" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/267/expected.json b/test/fixtures/core/uncategorised/267/expected.json index d9e30cca90..e44e902aa7 100644 --- a/test/fixtures/core/uncategorised/267/expected.json +++ b/test/fixtures/core/uncategorised/267/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -130,15 +132,18 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "bar" }, "name": "bar" } } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/268/expected.json b/test/fixtures/core/uncategorised/268/expected.json index e48fd0f035..b77f94e94a 100644 --- a/test/fixtures/core/uncategorised/268/expected.json +++ b/test/fixtures/core/uncategorised/268/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, "cases": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/269/expected.json b/test/fixtures/core/uncategorised/269/expected.json index 54b7c12792..3c3a42b257 100644 --- a/test/fixtures/core/uncategorised/269/expected.json +++ b/test/fixtures/core/uncategorised/269/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "answer" }, "name": "answer" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "hi" }, "name": "hi" }, diff --git a/test/fixtures/core/uncategorised/27/expected.json b/test/fixtures/core/uncategorised/27/expected.json index b292e26154..df92c26e13 100644 --- a/test/fixtures/core/uncategorised/27/expected.json +++ b/test/fixtures/core/uncategorised/27/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/270/expected.json b/test/fixtures/core/uncategorised/270/expected.json index ce967090f0..f474c77e7d 100644 --- a/test/fixtures/core/uncategorised/270/expected.json +++ b/test/fixtures/core/uncategorised/270/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "answer" }, "name": "answer" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "hi" }, "name": "hi" }, diff --git a/test/fixtures/core/uncategorised/271/expected.json b/test/fixtures/core/uncategorised/271/expected.json index ea2201a00e..0edfa7e1e6 100644 --- a/test/fixtures/core/uncategorised/271/expected.json +++ b/test/fixtures/core/uncategorised/271/expected.json @@ -85,7 +85,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "start" }, "name": "start" } @@ -103,11 +104,13 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "start" }, "name": "start" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/272/expected.json b/test/fixtures/core/uncategorised/272/expected.json index 5157602658..0c49d0e8f9 100644 --- a/test/fixtures/core/uncategorised/272/expected.json +++ b/test/fixtures/core/uncategorised/272/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "start" }, "name": "start" } @@ -116,7 +117,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "start" }, "name": "start" } diff --git a/test/fixtures/core/uncategorised/273/expected.json b/test/fixtures/core/uncategorised/273/expected.json index 0e9f3c0da0..a5a7fc11ac 100644 --- a/test/fixtures/core/uncategorised/273/expected.json +++ b/test/fixtures/core/uncategorised/273/expected.json @@ -54,11 +54,13 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/274/expected.json b/test/fixtures/core/uncategorised/274/expected.json index 91f3d0ffa7..fbc9ab8952 100644 --- a/test/fixtures/core/uncategorised/274/expected.json +++ b/test/fixtures/core/uncategorised/274/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/275/expected.json b/test/fixtures/core/uncategorised/275/expected.json index 1586888a8b..e0ef904785 100644 --- a/test/fixtures/core/uncategorised/275/expected.json +++ b/test/fixtures/core/uncategorised/275/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "message" }, "name": "message" }, diff --git a/test/fixtures/core/uncategorised/276/expected.json b/test/fixtures/core/uncategorised/276/expected.json index 49a3324324..e5753c7cc2 100644 --- a/test/fixtures/core/uncategorised/276/expected.json +++ b/test/fixtures/core/uncategorised/276/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -102,12 +104,14 @@ "column": 21 } }, - "body": [] + "body": [], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/277/expected.json b/test/fixtures/core/uncategorised/277/expected.json index 4fa8f999b5..7a8e08f5e0 100644 --- a/test/fixtures/core/uncategorised/277/expected.json +++ b/test/fixtures/core/uncategorised/277/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "eval" }, "name": "eval" }, @@ -102,12 +104,14 @@ "column": 24 } }, - "body": [] + "body": [], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/278/expected.json b/test/fixtures/core/uncategorised/278/expected.json index 42cc2e8bf7..a6eb4ec45b 100644 --- a/test/fixtures/core/uncategorised/278/expected.json +++ b/test/fixtures/core/uncategorised/278/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, @@ -102,12 +104,14 @@ "column": 29 } }, - "body": [] + "body": [], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/279/expected.json b/test/fixtures/core/uncategorised/279/expected.json index bb353db32f..2e17e596c6 100644 --- a/test/fixtures/core/uncategorised/279/expected.json +++ b/test/fixtures/core/uncategorised/279/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -143,7 +145,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "say" }, "name": "say" }, @@ -160,19 +163,22 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "e" }, "name": "e" } ] } } - ] + ], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/28/expected.json b/test/fixtures/core/uncategorised/28/expected.json index a2566571e4..c3ee0acf14 100644 --- a/test/fixtures/core/uncategorised/28/expected.json +++ b/test/fixtures/core/uncategorised/28/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -171,7 +173,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/280/expected.json b/test/fixtures/core/uncategorised/280/expected.json index ca8f6bd080..4f92072de7 100644 --- a/test/fixtures/core/uncategorised/280/expected.json +++ b/test/fixtures/core/uncategorised/280/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": null, "guardedHandlers": [], @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "cleanup" }, "name": "cleanup" }, @@ -132,16 +134,19 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "stuff" }, "name": "stuff" } ] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/281/expected.json b/test/fixtures/core/uncategorised/281/expected.json index 291705c18b..6024793dbd 100644 --- a/test/fixtures/core/uncategorised/281/expected.json +++ b/test/fixtures/core/uncategorised/281/expected.json @@ -97,14 +97,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "doThat" }, "name": "doThat" }, "arguments": [] } } - ] + ], + "directives": [] }, "handler": { "type": "CatchClause", @@ -132,7 +134,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -191,7 +194,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "say" }, "name": "say" }, @@ -208,19 +212,22 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "e" }, "name": "e" } ] } } - ] + ], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/282/expected.json b/test/fixtures/core/uncategorised/282/expected.json index 9dd799f3ee..c73f720c72 100644 --- a/test/fixtures/core/uncategorised/282/expected.json +++ b/test/fixtures/core/uncategorised/282/expected.json @@ -97,14 +97,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "doThat" }, "name": "doThat" }, "arguments": [] } } - ] + ], + "directives": [] }, "handler": { "type": "CatchClause", @@ -132,7 +134,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -191,7 +194,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "say" }, "name": "say" }, @@ -208,14 +212,16 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "e" }, "name": "e" } ] } } - ] + ], + "directives": [] } }, "guardedHandlers": [], @@ -274,7 +280,8 @@ "end": { "line": 1, "column": 56 - } + }, + "identifierName": "cleanup" }, "name": "cleanup" }, @@ -291,16 +298,19 @@ "end": { "line": 1, "column": 62 - } + }, + "identifierName": "stuff" }, "name": "stuff" } ] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/283/expected.json b/test/fixtures/core/uncategorised/283/expected.json index bf36100cfe..c70dc07eb5 100644 --- a/test/fixtures/core/uncategorised/283/expected.json +++ b/test/fixtures/core/uncategorised/283/expected.json @@ -43,6 +43,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/284/expected.json b/test/fixtures/core/uncategorised/284/expected.json index 8de460e887..89d8911652 100644 --- a/test/fixtures/core/uncategorised/284/expected.json +++ b/test/fixtures/core/uncategorised/284/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "hello" }, "name": "hello" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,16 +118,19 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/285/expected.json b/test/fixtures/core/uncategorised/285/expected.json index d8bcde0844..01acb188ed 100644 --- a/test/fixtures/core/uncategorised/285/expected.json +++ b/test/fixtures/core/uncategorised/285/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "eval" }, "name": "eval" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -75,9 +77,11 @@ "column": 19 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/286/expected.json b/test/fixtures/core/uncategorised/286/expected.json index 086e1ef65b..93d4d923bf 100644 --- a/test/fixtures/core/uncategorised/286/expected.json +++ b/test/fixtures/core/uncategorised/286/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -75,9 +77,11 @@ "column": 24 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/287/expected.json b/test/fixtures/core/uncategorised/287/expected.json index c081c978ea..05cce3b8f3 100644 --- a/test/fixtures/core/uncategorised/287/expected.json +++ b/test/fixtures/core/uncategorised/287/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "test" }, "name": "test" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "t" }, "name": "t" }, @@ -89,7 +92,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "t" }, "name": "t" } @@ -108,9 +112,11 @@ "column": 23 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/288/expected.json b/test/fixtures/core/uncategorised/288/expected.json index a9c517251e..4b79120694 100644 --- a/test/fixtures/core/uncategorised/288/expected.json +++ b/test/fixtures/core/uncategorised/288/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "test" }, "name": "test" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -87,7 +89,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "t" }, "name": "t" }, @@ -103,7 +106,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "t" }, "name": "t" } @@ -126,7 +130,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/289/expected.json b/test/fixtures/core/uncategorised/289/expected.json index 5924cefb02..1b08145eb9 100644 --- a/test/fixtures/core/uncategorised/289/expected.json +++ b/test/fixtures/core/uncategorised/289/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "eval" }, "name": "eval" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -102,12 +104,14 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "inner" }, "name": "inner" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/29/expected.json b/test/fixtures/core/uncategorised/29/expected.json index 1462403c0d..057f1cf08d 100644 --- a/test/fixtures/core/uncategorised/29/expected.json +++ b/test/fixtures/core/uncategorised/29/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "width" }, "name": "width" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -167,7 +170,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "m_width" }, "name": "m_width" } diff --git a/test/fixtures/core/uncategorised/290/expected.json b/test/fixtures/core/uncategorised/290/expected.json index 3d1b214f48..a5373f5a79 100644 --- a/test/fixtures/core/uncategorised/290/expected.json +++ b/test/fixtures/core/uncategorised/290/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "hello" }, "name": "hello" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "a" }, "name": "a" } @@ -133,16 +136,19 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/291/expected.json b/test/fixtures/core/uncategorised/291/expected.json index 8bc6714852..cdfeb7b019 100644 --- a/test/fixtures/core/uncategorised/291/expected.json +++ b/test/fixtures/core/uncategorised/291/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "hello" }, "name": "hello" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -89,7 +92,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "b" }, "name": "b" } @@ -149,16 +153,19 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/292/expected.json b/test/fixtures/core/uncategorised/292/expected.json index 70213bc4ee..2a928b39d2 100644 --- a/test/fixtures/core/uncategorised/292/expected.json +++ b/test/fixtures/core/uncategorised/292/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "hello" }, "name": "hello" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "RestElement", @@ -87,7 +89,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "rest" }, "name": "rest" } @@ -107,9 +110,11 @@ "column": 27 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/293/expected.json b/test/fixtures/core/uncategorised/293/expected.json index 73f53f2cd1..ed3d6655c1 100644 --- a/test/fixtures/core/uncategorised/293/expected.json +++ b/test/fixtures/core/uncategorised/293/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "hello" }, "name": "hello" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -103,7 +106,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "rest" }, "name": "rest" } @@ -123,9 +127,11 @@ "column": 30 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/294/expected.json b/test/fixtures/core/uncategorised/294/expected.json index 6483debdcd..7df304a88a 100644 --- a/test/fixtures/core/uncategorised/294/expected.json +++ b/test/fixtures/core/uncategorised/294/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "hi" }, "name": "hi" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -146,20 +148,23 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/295/expected.json b/test/fixtures/core/uncategorised/295/expected.json index 3aee1a20fd..53520cfe7f 100644 --- a/test/fixtures/core/uncategorised/295/expected.json +++ b/test/fixtures/core/uncategorised/295/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "hi" }, "name": "hi" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "RestElement", @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "r" }, "name": "r" } @@ -178,20 +181,23 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/296/expected.json b/test/fixtures/core/uncategorised/296/expected.json index b4b770ef03..ce5cb42288 100644 --- a/test/fixtures/core/uncategorised/296/expected.json +++ b/test/fixtures/core/uncategorised/296/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "hi" }, "name": "hi" }, @@ -99,12 +100,14 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "eval" }, "name": "eval" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -120,13 +123,15 @@ "column": 28 } }, - "body": [] + "body": [], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/297/expected.json b/test/fixtures/core/uncategorised/297/expected.json index 75abd7b81c..2b88f0d953 100644 --- a/test/fixtures/core/uncategorised/297/expected.json +++ b/test/fixtures/core/uncategorised/297/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "hi" }, "name": "hi" }, @@ -99,12 +100,14 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -120,13 +123,15 @@ "column": 33 } }, - "body": [] + "body": [], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/298/expected.json b/test/fixtures/core/uncategorised/298/expected.json index 71c7365c51..f3e529622f 100644 --- a/test/fixtures/core/uncategorised/298/expected.json +++ b/test/fixtures/core/uncategorised/298/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "hello" }, "name": "hello" }, @@ -99,12 +100,14 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "hi" }, "name": "hi" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -161,20 +164,23 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/299/expected.json b/test/fixtures/core/uncategorised/299/expected.json index fac0f4b32c..f79af90cc1 100644 --- a/test/fixtures/core/uncategorised/299/expected.json +++ b/test/fixtures/core/uncategorised/299/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -78,7 +79,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/30/expected.json b/test/fixtures/core/uncategorised/30/expected.json index 7694f2fd33..b2a8bf8168 100644 --- a/test/fixtures/core/uncategorised/30/expected.json +++ b/test/fixtures/core/uncategorised/30/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "undef" }, "name": "undef" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/300/expected.json b/test/fixtures/core/uncategorised/300/expected.json index bab8079535..855b9666cc 100644 --- a/test/fixtures/core/uncategorised/300/expected.json +++ b/test/fixtures/core/uncategorised/300/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" } @@ -116,14 +117,20 @@ "end": { "line": 2, "column": 3 - } + }, + "identifierName": "y" }, "name": "y" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/301/expected.json b/test/fixtures/core/uncategorised/301/expected.json index e7aa5f92ff..f531eb96b4 100644 --- a/test/fixtures/core/uncategorised/301/expected.json +++ b/test/fixtures/core/uncategorised/301/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" } @@ -116,14 +117,20 @@ "end": { "line": 2, "column": 3 - } + }, + "identifierName": "y" }, "name": "y" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/302/expected.json b/test/fixtures/core/uncategorised/302/expected.json index b80d317427..3840e25325 100644 --- a/test/fixtures/core/uncategorised/302/expected.json +++ b/test/fixtures/core/uncategorised/302/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x", "leadingComments": null, diff --git a/test/fixtures/core/uncategorised/303/expected.json b/test/fixtures/core/uncategorised/303/expected.json index 0c955c4730..3881fa499d 100644 --- a/test/fixtures/core/uncategorised/303/expected.json +++ b/test/fixtures/core/uncategorised/303/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -135,7 +136,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -189,7 +191,8 @@ "end": { "line": 2, "column": 1 - } + }, + "identifierName": "z" }, "name": "z" } diff --git a/test/fixtures/core/uncategorised/304/expected.json b/test/fixtures/core/uncategorised/304/expected.json index 1c02f6ef66..84e28f3bd9 100644 --- a/test/fixtures/core/uncategorised/304/expected.json +++ b/test/fixtures/core/uncategorised/304/expected.json @@ -115,7 +115,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "there" }, "name": "there" } diff --git a/test/fixtures/core/uncategorised/305/expected.json b/test/fixtures/core/uncategorised/305/expected.json index 675fe056a3..fd7f41293b 100644 --- a/test/fixtures/core/uncategorised/305/expected.json +++ b/test/fixtures/core/uncategorised/305/expected.json @@ -134,7 +134,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "there" }, "name": "there", "leadingComments": null diff --git a/test/fixtures/core/uncategorised/306/expected.json b/test/fixtures/core/uncategorised/306/expected.json index dfef6b5c50..820264c6d1 100644 --- a/test/fixtures/core/uncategorised/306/expected.json +++ b/test/fixtures/core/uncategorised/306/expected.json @@ -134,7 +134,8 @@ "end": { "line": 2, "column": 15 - } + }, + "identifierName": "there" }, "name": "there", "leadingComments": null diff --git a/test/fixtures/core/uncategorised/307/expected.json b/test/fixtures/core/uncategorised/307/expected.json index 2b8d9fef9f..560762d177 100644 --- a/test/fixtures/core/uncategorised/307/expected.json +++ b/test/fixtures/core/uncategorised/307/expected.json @@ -115,7 +115,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "there" }, "name": "there" } diff --git a/test/fixtures/core/uncategorised/308/expected.json b/test/fixtures/core/uncategorised/308/expected.json index 21c911cbbc..b5794cac3a 100644 --- a/test/fixtures/core/uncategorised/308/expected.json +++ b/test/fixtures/core/uncategorised/308/expected.json @@ -134,7 +134,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "there" }, "name": "there", "leadingComments": null diff --git a/test/fixtures/core/uncategorised/309/expected.json b/test/fixtures/core/uncategorised/309/expected.json index 55ac6a29a8..62b72404df 100644 --- a/test/fixtures/core/uncategorised/309/expected.json +++ b/test/fixtures/core/uncategorised/309/expected.json @@ -134,7 +134,8 @@ "end": { "line": 2, "column": 15 - } + }, + "identifierName": "there" }, "name": "there", "leadingComments": null diff --git a/test/fixtures/core/uncategorised/31/expected.json b/test/fixtures/core/uncategorised/31/expected.json index 966b9f90ca..5b18965177 100644 --- a/test/fixtures/core/uncategorised/31/expected.json +++ b/test/fixtures/core/uncategorised/31/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "if" }, "name": "if" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/310/expected.json b/test/fixtures/core/uncategorised/310/expected.json index 7d4c8d5bb6..e5fa9ec260 100644 --- a/test/fixtures/core/uncategorised/310/expected.json +++ b/test/fixtures/core/uncategorised/310/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,7 +118,8 @@ "end": { "line": 2, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" } @@ -126,7 +128,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/311/expected.json b/test/fixtures/core/uncategorised/311/expected.json index f0cf8a4b53..3b50dd8b73 100644 --- a/test/fixtures/core/uncategorised/311/expected.json +++ b/test/fixtures/core/uncategorised/311/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -136,7 +137,8 @@ "end": { "line": 2, "column": 1 - } + }, + "identifierName": "x" }, "name": "x", "leadingComments": null @@ -164,7 +166,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/312/expected.json b/test/fixtures/core/uncategorised/312/expected.json index 975bfdf605..6ae21e8aa6 100644 --- a/test/fixtures/core/uncategorised/312/expected.json +++ b/test/fixtures/core/uncategorised/312/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -136,7 +137,8 @@ "end": { "line": 2, "column": 11 - } + }, + "identifierName": "x" }, "name": "x", "leadingComments": null @@ -164,7 +166,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/313/expected.json b/test/fixtures/core/uncategorised/313/expected.json index d55af430c7..d1fb3ac429 100644 --- a/test/fixtures/core/uncategorised/313/expected.json +++ b/test/fixtures/core/uncategorised/313/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "error" }, "name": "error" } @@ -100,13 +101,16 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "error" }, "name": "error" } } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/314/expected.json b/test/fixtures/core/uncategorised/314/expected.json index 1340d70360..55562ff024 100644 --- a/test/fixtures/core/uncategorised/314/expected.json +++ b/test/fixtures/core/uncategorised/314/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "error" }, "name": "error", "leadingComments": null, @@ -120,7 +121,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "error" }, "name": "error", "leadingComments": null diff --git a/test/fixtures/core/uncategorised/315/expected.json b/test/fixtures/core/uncategorised/315/expected.json index fcf481f414..acb5183a09 100644 --- a/test/fixtures/core/uncategorised/315/expected.json +++ b/test/fixtures/core/uncategorised/315/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "error" }, "name": "error", "leadingComments": null, @@ -120,7 +121,8 @@ "end": { "line": 2, "column": 15 - } + }, + "identifierName": "error" }, "name": "error", "leadingComments": null diff --git a/test/fixtures/core/uncategorised/316/expected.json b/test/fixtures/core/uncategorised/316/expected.json index 10130f3578..1df1b8a0fb 100644 --- a/test/fixtures/core/uncategorised/316/expected.json +++ b/test/fixtures/core/uncategorised/316/expected.json @@ -27,6 +27,7 @@ } }, "sourceType": "script", - "body": [] + "body": [], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/317/expected.json b/test/fixtures/core/uncategorised/317/expected.json index 96b5884573..75aac067bd 100644 --- a/test/fixtures/core/uncategorised/317/expected.json +++ b/test/fixtures/core/uncategorised/317/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/core/uncategorised/318/expected.json b/test/fixtures/core/uncategorised/318/expected.json index 1fda36e9a7..be25c9494b 100644 --- a/test/fixtures/core/uncategorised/318/expected.json +++ b/test/fixtures/core/uncategorised/318/expected.json @@ -73,6 +73,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -165,7 +166,8 @@ }, "arguments": [], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/319/expected.json b/test/fixtures/core/uncategorised/319/expected.json index 9cb04403f1..712b896d4b 100644 --- a/test/fixtures/core/uncategorised/319/expected.json +++ b/test/fixtures/core/uncategorised/319/expected.json @@ -102,7 +102,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "toString" }, "name": "toString" }, diff --git a/test/fixtures/core/uncategorised/32/expected.json b/test/fixtures/core/uncategorised/32/expected.json index 0ab2082d42..5ed0dee78e 100644 --- a/test/fixtures/core/uncategorised/32/expected.json +++ b/test/fixtures/core/uncategorised/32/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "true" }, "name": "true" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/321/expected.json b/test/fixtures/core/uncategorised/321/expected.json index 0fbaec1ec3..93c8373aec 100644 --- a/test/fixtures/core/uncategorised/321/expected.json +++ b/test/fixtures/core/uncategorised/321/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" } @@ -85,11 +86,13 @@ "end": { "line": 2, "column": 1 - } + }, + "identifierName": "b" }, "name": "b" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/323/expected.json b/test/fixtures/core/uncategorised/323/expected.json index 662a04aa6e..1fd3d16a4b 100644 --- a/test/fixtures/core/uncategorised/323/expected.json +++ b/test/fixtures/core/uncategorised/323/expected.json @@ -89,7 +89,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -155,7 +156,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/core/uncategorised/325/expected.json b/test/fixtures/core/uncategorised/325/expected.json index 60a0422da0..2d2a386aeb 100644 --- a/test/fixtures/core/uncategorised/325/expected.json +++ b/test/fixtures/core/uncategorised/325/expected.json @@ -54,11 +54,13 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "price_9̶9̶_89" }, "name": "price_9̶9̶_89" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/326/expected.json b/test/fixtures/core/uncategorised/326/expected.json index ddb03e0cb1..818768b81f 100644 --- a/test/fixtures/core/uncategorised/326/expected.json +++ b/test/fixtures/core/uncategorised/326/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "in" }, "name": "in" }, @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/327/expected.json b/test/fixtures/core/uncategorised/327/expected.json index 9e26dfeeb6..faafaf7932 100644 --- a/test/fixtures/core/uncategorised/327/expected.json +++ b/test/fixtures/core/uncategorised/327/expected.json @@ -1 +1,101 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ReturnStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "BinaryExpression", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "ObjectExpression", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "properties": [] + }, + "operator": "/", + "right": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/328/expected.json b/test/fixtures/core/uncategorised/328/expected.json index 9e26dfeeb6..fdb2242bec 100644 --- a/test/fixtures/core/uncategorised/328/expected.json +++ b/test/fixtures/core/uncategorised/328/expected.json @@ -1 +1,102 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ReturnStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "argument": null + }, + { + "type": "BlockStatement", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "body": [], + "directives": [] + }, + { + "type": "ExpressionStatement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "extra": { + "raw": "/foo/" + }, + "pattern": "foo", + "flags": "" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/329/expected.json b/test/fixtures/core/uncategorised/329/expected.json index 9e26dfeeb6..a8b5a5435c 100644 --- a/test/fixtures/core/uncategorised/329/expected.json +++ b/test/fixtures/core/uncategorised/329/expected.json @@ -1 +1,121 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "UnaryExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "ObjectExpression", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "properties": [] + }, + "extra": { + "parenthesizedArgument": false + } + }, + "operator": "/", + "right": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/33/expected.json b/test/fixtures/core/uncategorised/33/expected.json index ccc78d04a7..a0a3fa12fd 100644 --- a/test/fixtures/core/uncategorised/33/expected.json +++ b/test/fixtures/core/uncategorised/33/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "false" }, "name": "false" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/330/expected.json b/test/fixtures/core/uncategorised/330/expected.json index 9e26dfeeb6..0f4d9b4428 100644 --- a/test/fixtures/core/uncategorised/330/expected.json +++ b/test/fixtures/core/uncategorised/330/expected.json @@ -1 +1,86 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "body": [], + "directives": [] + }, + { + "type": "ExpressionStatement", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "extra": { + "raw": "/foo/" + }, + "pattern": "foo", + "flags": "" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/331/expected.json b/test/fixtures/core/uncategorised/331/expected.json index 9e26dfeeb6..e5046ea184 100644 --- a/test/fixtures/core/uncategorised/331/expected.json +++ b/test/fixtures/core/uncategorised/331/expected.json @@ -1 +1,135 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + }, + { + "type": "BlockStatement", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "body": [], + "directives": [] + }, + { + "type": "ExpressionStatement", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "extra": { + "raw": "/foo/" + }, + "pattern": "foo", + "flags": "" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/332/expected.json b/test/fixtures/core/uncategorised/332/expected.json index 9e26dfeeb6..aace18f78b 100644 --- a/test/fixtures/core/uncategorised/332/expected.json +++ b/test/fixtures/core/uncategorised/332/expected.json @@ -1 +1,104 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "body": [ + { + "type": "BlockStatement", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "body": [], + "directives": [] + }, + { + "type": "ExpressionStatement", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "extra": { + "raw": "/foo/" + }, + "pattern": "foo", + "flags": "" + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/333/expected.json b/test/fixtures/core/uncategorised/333/expected.json index 9e26dfeeb6..f8c581d82e 100644 --- a/test/fixtures/core/uncategorised/333/expected.json +++ b/test/fixtures/core/uncategorised/333/expected.json @@ -1 +1,104 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "test": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "body": { + "type": "ExpressionStatement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "raw": "/foo/" + }, + "pattern": "foo", + "flags": "" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/334/expected.json b/test/fixtures/core/uncategorised/334/expected.json index 9e26dfeeb6..abfa6cae3c 100644 --- a/test/fixtures/core/uncategorised/334/expected.json +++ b/test/fixtures/core/uncategorised/334/expected.json @@ -1 +1,107 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "NumericLiteral", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 1 + }, + "operator": "/", + "right": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/335/expected.json b/test/fixtures/core/uncategorised/335/expected.json index 9e26dfeeb6..7ecc877cd8 100644 --- a/test/fixtures/core/uncategorised/335/expected.json +++ b/test/fixtures/core/uncategorised/335/expected.json @@ -1 +1,210 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "BinaryExpression", + "start": 1, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "left": { + "type": "ObjectExpression", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "ArrayExpression", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ] + } + } + ] + }, + "operator": "+", + "right": { + "type": "ArrayExpression", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "elements": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "operator": "/", + "right": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/336/expected.json b/test/fixtures/core/uncategorised/336/expected.json index 9e26dfeeb6..63ecb1d5de 100644 --- a/test/fixtures/core/uncategorised/336/expected.json +++ b/test/fixtures/core/uncategorised/336/expected.json @@ -1 +1,139 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ] + } + } + ], + "directives": [] + }, + { + "type": "ExpressionStatement", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "extra": { + "raw": "/foo/" + }, + "pattern": "foo", + "flags": "" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/337/expected.json b/test/fixtures/core/uncategorised/337/expected.json index 9e26dfeeb6..202e7d6c52 100644 --- a/test/fixtures/core/uncategorised/337/expected.json +++ b/test/fixtures/core/uncategorised/337/expected.json @@ -1 +1,157 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "sourceType": "script", + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "discriminant": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 12, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "consequent": [ + { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + }, + { + "type": "ExpressionStatement", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "extra": { + "raw": "/foo/" + }, + "pattern": "foo", + "flags": "" + } + } + ], + "test": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/338/expected.json b/test/fixtures/core/uncategorised/338/expected.json index 9e26dfeeb6..fe0875e9a4 100644 --- a/test/fixtures/core/uncategorised/338/expected.json +++ b/test/fixtures/core/uncategorised/338/expected.json @@ -1 +1,160 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "value": { + "type": "BinaryExpression", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "ObjectExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "properties": [] + }, + "operator": "/", + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/339/expected.json b/test/fixtures/core/uncategorised/339/expected.json index 9e26dfeeb6..f219c75e64 100644 --- a/test/fixtures/core/uncategorised/339/expected.json +++ b/test/fixtures/core/uncategorised/339/expected.json @@ -1 +1,139 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "UnaryExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "UpdateExpression", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "extra": { + "parenthesizedArgument": false + } + }, + "operator": "/", + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/34/expected.json b/test/fixtures/core/uncategorised/34/expected.json index c8ef1380a8..5ccdf34d1e 100644 --- a/test/fixtures/core/uncategorised/34/expected.json +++ b/test/fixtures/core/uncategorised/34/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "null" }, "name": "null" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/340/expected.json b/test/fixtures/core/uncategorised/340/expected.json index 9e26dfeeb6..7ccbc843ad 100644 --- a/test/fixtures/core/uncategorised/340/expected.json +++ b/test/fixtures/core/uncategorised/340/expected.json @@ -1 +1,151 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "MemberExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "in" + }, + "name": "in" + }, + "computed": false + } + }, + { + "type": "BlockStatement", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "body": [], + "directives": [] + }, + { + "type": "ExpressionStatement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "extra": { + "raw": "/foo/" + }, + "pattern": "foo", + "flags": "" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/342/expected.json b/test/fixtures/core/uncategorised/342/expected.json index 418f936ff6..4501a541b5 100644 --- a/test/fixtures/core/uncategorised/342/expected.json +++ b/test/fixtures/core/uncategorised/342/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "foo" }, "name": "foo", "leadingComments": null, @@ -104,7 +105,8 @@ "end": { "line": 2, "column": 4 - } + }, + "identifierName": "baz" }, "name": "baz", "leadingComments": [ diff --git a/test/fixtures/core/uncategorised/343/expected.json b/test/fixtures/core/uncategorised/343/expected.json index e3a56910e4..16b19e6130 100644 --- a/test/fixtures/core/uncategorised/343/expected.json +++ b/test/fixtures/core/uncategorised/343/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/core/uncategorised/344/expected.json b/test/fixtures/core/uncategorised/344/expected.json index 827aebf2db..7bf2896043 100644 --- a/test/fixtures/core/uncategorised/344/expected.json +++ b/test/fixtures/core/uncategorised/344/expected.json @@ -82,7 +82,8 @@ "end": { "line": 2, "column": 6 - } + }, + "identifierName": "object" }, "name": "object" }, @@ -98,7 +99,8 @@ "end": { "line": 2, "column": 13 - } + }, + "identifierName": "static" }, "name": "static" }, diff --git a/test/fixtures/core/uncategorised/35/expected.json b/test/fixtures/core/uncategorised/35/expected.json index 6a4504c896..36830ddf37 100644 --- a/test/fixtures/core/uncategorised/35/expected.json +++ b/test/fixtures/core/uncategorised/35/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -129,6 +130,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/36/expected.json b/test/fixtures/core/uncategorised/36/expected.json index 80eca1b9e4..dfbd42e884 100644 --- a/test/fixtures/core/uncategorised/36/expected.json +++ b/test/fixtures/core/uncategorised/36/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -129,6 +130,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/37/expected.json b/test/fixtures/core/uncategorised/37/expected.json index ad75991dc1..821787cfd7 100644 --- a/test/fixtures/core/uncategorised/37/expected.json +++ b/test/fixtures/core/uncategorised/37/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "width" }, "name": "width" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -138,7 +141,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "w" }, "name": "w" } @@ -199,7 +203,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "m_width" }, "name": "m_width" }, @@ -215,7 +220,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "w" }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/38/expected.json b/test/fixtures/core/uncategorised/38/expected.json index e290b184de..8b525fb80c 100644 --- a/test/fixtures/core/uncategorised/38/expected.json +++ b/test/fixtures/core/uncategorised/38/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "if" }, "name": "if" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -138,7 +141,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "w" }, "name": "w" } @@ -199,7 +203,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "m_if" }, "name": "m_if" }, @@ -215,7 +220,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "w" }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/39/expected.json b/test/fixtures/core/uncategorised/39/expected.json index 60ca06a14b..6d693c7fb0 100644 --- a/test/fixtures/core/uncategorised/39/expected.json +++ b/test/fixtures/core/uncategorised/39/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "true" }, "name": "true" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -138,7 +141,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "w" }, "name": "w" } @@ -199,7 +203,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "m_true" }, "name": "m_true" }, @@ -215,7 +220,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "w" }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/40/expected.json b/test/fixtures/core/uncategorised/40/expected.json index 2e92b355f6..226cdce5f6 100644 --- a/test/fixtures/core/uncategorised/40/expected.json +++ b/test/fixtures/core/uncategorised/40/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "false" }, "name": "false" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -138,7 +141,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "w" }, "name": "w" } @@ -199,7 +203,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "m_false" }, "name": "m_false" }, @@ -215,7 +220,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "w" }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/41/expected.json b/test/fixtures/core/uncategorised/41/expected.json index af9300d188..6fb466dce4 100644 --- a/test/fixtures/core/uncategorised/41/expected.json +++ b/test/fixtures/core/uncategorised/41/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "null" }, "name": "null" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -138,7 +141,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "w" }, "name": "w" } @@ -199,7 +203,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "m_null" }, "name": "m_null" }, @@ -215,7 +220,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "w" }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/42/expected.json b/test/fixtures/core/uncategorised/42/expected.json index 7bc3ec6059..c0d601a0c6 100644 --- a/test/fixtures/core/uncategorised/42/expected.json +++ b/test/fixtures/core/uncategorised/42/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -129,6 +130,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -142,7 +144,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "w" }, "name": "w" } @@ -203,7 +206,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "m_null" }, "name": "m_null" }, @@ -219,7 +223,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "w" }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/43/expected.json b/test/fixtures/core/uncategorised/43/expected.json index b2b46810dc..ef2d3f1eb7 100644 --- a/test/fixtures/core/uncategorised/43/expected.json +++ b/test/fixtures/core/uncategorised/43/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -129,6 +130,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -142,7 +144,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "w" }, "name": "w" } @@ -203,7 +206,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "m_null" }, "name": "m_null" }, @@ -219,7 +223,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "w" }, "name": "w" } diff --git a/test/fixtures/core/uncategorised/44/expected.json b/test/fixtures/core/uncategorised/44/expected.json index 33f2638826..da5e30670e 100644 --- a/test/fixtures/core/uncategorised/44/expected.json +++ b/test/fixtures/core/uncategorised/44/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "get" }, "name": "get" }, diff --git a/test/fixtures/core/uncategorised/45/expected.json b/test/fixtures/core/uncategorised/45/expected.json index bb724805ea..36c20d4050 100644 --- a/test/fixtures/core/uncategorised/45/expected.json +++ b/test/fixtures/core/uncategorised/45/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "set" }, "name": "set" }, diff --git a/test/fixtures/core/uncategorised/525/expected.json b/test/fixtures/core/uncategorised/525/expected.json index 9e7caa0016..76753120a1 100644 --- a/test/fixtures/core/uncategorised/525/expected.json +++ b/test/fixtures/core/uncategorised/525/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -78,6 +79,7 @@ ], "kind": "let" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/526/expected.json b/test/fixtures/core/uncategorised/526/expected.json index 9e32e59ad2..e762adfed3 100644 --- a/test/fixtures/core/uncategorised/526/expected.json +++ b/test/fixtures/core/uncategorised/526/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -101,7 +102,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -110,6 +112,7 @@ ], "kind": "let" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/527/expected.json b/test/fixtures/core/uncategorised/527/expected.json index 8db391b3af..157910021f 100644 --- a/test/fixtures/core/uncategorised/527/expected.json +++ b/test/fixtures/core/uncategorised/527/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/528/expected.json b/test/fixtures/core/uncategorised/528/expected.json index ebe4c4d182..f678e52654 100644 --- a/test/fixtures/core/uncategorised/528/expected.json +++ b/test/fixtures/core/uncategorised/528/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "eval" }, "name": "eval" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, diff --git a/test/fixtures/core/uncategorised/529/expected.json b/test/fixtures/core/uncategorised/529/expected.json index e883fbe4f2..1067b58643 100644 --- a/test/fixtures/core/uncategorised/529/expected.json +++ b/test/fixtures/core/uncategorised/529/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -171,7 +173,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "z" }, "name": "z" }, diff --git a/test/fixtures/core/uncategorised/530/expected.json b/test/fixtures/core/uncategorised/530/expected.json index ced9b7da30..a1ccc73433 100644 --- a/test/fixtures/core/uncategorised/530/expected.json +++ b/test/fixtures/core/uncategorised/530/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/531/expected.json b/test/fixtures/core/uncategorised/531/expected.json index a40116c512..26a28de03c 100644 --- a/test/fixtures/core/uncategorised/531/expected.json +++ b/test/fixtures/core/uncategorised/531/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "y" }, "name": "y" }, diff --git a/test/fixtures/core/uncategorised/532/expected.json b/test/fixtures/core/uncategorised/532/expected.json index 12d30b3dd3..c86ced2dd6 100644 --- a/test/fixtures/core/uncategorised/532/expected.json +++ b/test/fixtures/core/uncategorised/532/expected.json @@ -42,6 +42,7 @@ "column": 31 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -148,7 +151,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -165,7 +169,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "x" }, "name": "x" } @@ -173,6 +178,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/533/expected.json b/test/fixtures/core/uncategorised/533/expected.json index e194cd4fc2..5b8946932d 100644 --- a/test/fixtures/core/uncategorised/533/expected.json +++ b/test/fixtures/core/uncategorised/533/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/534/expected.json b/test/fixtures/core/uncategorised/534/expected.json index ee0b458ad8..e09754f492 100644 --- a/test/fixtures/core/uncategorised/534/expected.json +++ b/test/fixtures/core/uncategorised/534/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "eval" }, "name": "eval" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, diff --git a/test/fixtures/core/uncategorised/535/expected.json b/test/fixtures/core/uncategorised/535/expected.json index 446cd2cbed..62dc6d154e 100644 --- a/test/fixtures/core/uncategorised/535/expected.json +++ b/test/fixtures/core/uncategorised/535/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -171,7 +173,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "z" }, "name": "z" }, diff --git a/test/fixtures/core/uncategorised/537/expected.json b/test/fixtures/core/uncategorised/537/expected.json index 0ad053b30e..958b6ab0cc 100644 --- a/test/fixtures/core/uncategorised/537/expected.json +++ b/test/fixtures/core/uncategorised/537/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/core/uncategorised/539/expected.json b/test/fixtures/core/uncategorised/539/expected.json index 9e26dfeeb6..2bd4333d31 100644 --- a/test/fixtures/core/uncategorised/539/expected.json +++ b/test/fixtures/core/uncategorised/539/expected.json @@ -1 +1,141 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "f" + }, + "name": "f" + } + ], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 16, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": "use strict", + "extra": { + "raw": "'use strict'", + "rawValue": "use strict" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/540/expected.json b/test/fixtures/core/uncategorised/540/expected.json index ffbcf34606..0decbaaefa 100644 --- a/test/fixtures/core/uncategorised/540/expected.json +++ b/test/fixtures/core/uncategorised/540/expected.json @@ -73,6 +73,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -114,7 +115,8 @@ "value": 1 }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/core/uncategorised/541/expected.json b/test/fixtures/core/uncategorised/541/expected.json index c9f5c36ac7..db7df06cb3 100644 --- a/test/fixtures/core/uncategorised/541/expected.json +++ b/test/fixtures/core/uncategorised/541/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/542/expected.json b/test/fixtures/core/uncategorised/542/expected.json index dac534f2f7..3dc935f6be 100644 --- a/test/fixtures/core/uncategorised/542/expected.json +++ b/test/fixtures/core/uncategorised/542/expected.json @@ -102,7 +102,8 @@ "end": { "line": 2, "column": 6 - } + }, + "identifierName": "split" }, "name": "split" }, @@ -135,4 +136,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/543/expected.json b/test/fixtures/core/uncategorised/543/expected.json index ecc6f809c9..174e12e8d2 100644 --- a/test/fixtures/core/uncategorised/543/expected.json +++ b/test/fixtures/core/uncategorised/543/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "fn" }, "name": "fn" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/core/uncategorised/6/expected.json b/test/fixtures/core/uncategorised/6/expected.json index 33043e035c..213f57310d 100644 --- a/test/fixtures/core/uncategorised/6/expected.json +++ b/test/fixtures/core/uncategorised/6/expected.json @@ -112,7 +112,8 @@ "value": 2 }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } }, "operator": "*", diff --git a/test/fixtures/core/uncategorised/64/expected.json b/test/fixtures/core/uncategorised/64/expected.json index 417e718ef6..9c1a6d4b50 100644 --- a/test/fixtures/core/uncategorised/64/expected.json +++ b/test/fixtures/core/uncategorised/64/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -113,7 +114,8 @@ "end": { "line": 2, "column": 6 - } + }, + "identifierName": "doThat" }, "name": "doThat", "leadingComments": null diff --git a/test/fixtures/core/uncategorised/65/expected.json b/test/fixtures/core/uncategorised/65/expected.json index 7a17ba3527..dfcf35acfe 100644 --- a/test/fixtures/core/uncategorised/65/expected.json +++ b/test/fixtures/core/uncategorised/65/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "answer" }, "name": "answer" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 46 - } + }, + "identifierName": "bingo" }, "name": "bingo", "leadingComments": null diff --git a/test/fixtures/core/uncategorised/7/expected.json b/test/fixtures/core/uncategorised/7/expected.json index eecbadfa66..7653286f2a 100644 --- a/test/fixtures/core/uncategorised/7/expected.json +++ b/test/fixtures/core/uncategorised/7/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -91,6 +92,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/8/expected.json b/test/fixtures/core/uncategorised/8/expected.json index afd3885785..a971641682 100644 --- a/test/fixtures/core/uncategorised/8/expected.json +++ b/test/fixtures/core/uncategorised/8/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -91,6 +92,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/9/expected.json b/test/fixtures/core/uncategorised/9/expected.json index 13c08de8ec..e07b3ce88d 100644 --- a/test/fixtures/core/uncategorised/9/expected.json +++ b/test/fixtures/core/uncategorised/9/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json b/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json index e733023e1c..718795d103 100644 --- a/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json +++ b/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -135,7 +137,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "title" }, "name": "title" }, @@ -151,7 +154,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "title" }, "name": "title" }, @@ -185,7 +189,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "other" }, "name": "other" } @@ -218,4 +223,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/es2015/class-methods/linebreaks/expected.json b/test/fixtures/es2015/class-methods/linebreaks/expected.json index 62dcad3c53..7094788e97 100644 --- a/test/fixtures/es2015/class-methods/linebreaks/expected.json +++ b/test/fixtures/es2015/class-methods/linebreaks/expected.json @@ -90,7 +90,6 @@ } }, "static": false, - "kind": "get", "computed": false, "key": { "type": "Identifier", @@ -109,6 +108,7 @@ }, "name": "a" }, + "kind": "get", "id": null, "generator": false, "expression": false, @@ -147,7 +147,6 @@ } }, "static": false, - "kind": "set", "computed": false, "key": { "type": "Identifier", @@ -166,6 +165,7 @@ }, "name": "a" }, + "kind": "set", "id": null, "generator": false, "expression": false, @@ -393,7 +393,6 @@ } }, "static": true, - "kind": "get", "computed": false, "key": { "type": "Identifier", @@ -412,6 +411,7 @@ }, "name": "a" }, + "kind": "get", "id": null, "generator": false, "expression": false, @@ -450,7 +450,6 @@ } }, "static": true, - "kind": "set", "computed": false, "key": { "type": "Identifier", @@ -469,6 +468,7 @@ }, "name": "a" }, + "kind": "set", "id": null, "generator": false, "expression": false, diff --git a/test/fixtures/es2015/class-methods/tricky-names/expected.json b/test/fixtures/es2015/class-methods/tricky-names/expected.json index 27b74a271b..5a167e4d71 100644 --- a/test/fixtures/es2015/class-methods/tricky-names/expected.json +++ b/test/fixtures/es2015/class-methods/tricky-names/expected.json @@ -90,7 +90,6 @@ } }, "static": false, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -109,6 +108,7 @@ }, "name": "get" }, + "kind": "method", "id": null, "generator": false, "expression": false, @@ -147,7 +147,6 @@ } }, "static": false, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -166,6 +165,7 @@ }, "name": "set" }, + "kind": "method", "id": null, "generator": false, "expression": false, @@ -261,7 +261,6 @@ } }, "static": false, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -280,6 +279,7 @@ }, "name": "async" }, + "kind": "method", "id": null, "generator": false, "expression": false, @@ -318,7 +318,6 @@ } }, "static": true, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -337,6 +336,7 @@ }, "name": "get" }, + "kind": "method", "id": null, "generator": false, "expression": false, @@ -375,7 +375,6 @@ } }, "static": true, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -394,6 +393,7 @@ }, "name": "set" }, + "kind": "method", "id": null, "generator": false, "expression": false, @@ -489,7 +489,6 @@ } }, "static": true, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -508,6 +507,7 @@ }, "name": "async" }, + "kind": "method", "id": null, "generator": false, "expression": false, @@ -603,7 +603,6 @@ } }, "static": false, - "kind": "get", "computed": false, "key": { "type": "Identifier", @@ -622,6 +621,7 @@ }, "name": "async" }, + "kind": "get", "id": null, "generator": false, "expression": false, @@ -660,7 +660,6 @@ } }, "static": true, - "kind": "get", "computed": false, "key": { "type": "Identifier", @@ -679,6 +678,7 @@ }, "name": "static" }, + "kind": "get", "id": null, "generator": false, "expression": false, diff --git a/test/fixtures/es2015/computed-properties/call-expression/expected.json b/test/fixtures/es2015/computed-properties/call-expression/expected.json index 6a6f627eec..876a6855b0 100644 --- a/test/fixtures/es2015/computed-properties/call-expression/expected.json +++ b/test/fixtures/es2015/computed-properties/call-expression/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -131,7 +132,8 @@ "end": { "line": 2, "column": 6 - } + }, + "identifierName": "bar" }, "name": "bar" }, diff --git a/test/fixtures/es2015/modules/duplicate-named-export-destructuring/expected.json b/test/fixtures/es2015/modules/duplicate-named-export-destructuring/expected.json index 3d8ba60894..7b3fa80cce 100644 --- a/test/fixtures/es2015/modules/duplicate-named-export-destructuring/expected.json +++ b/test/fixtures/es2015/modules/duplicate-named-export-destructuring/expected.json @@ -2521,7 +2521,8 @@ "end": { "line": 12, "column": 18 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -2554,7 +2555,8 @@ "end": { "line": 12, "column": 29 - } + }, + "identifierName": "qux7" }, "name": "qux7" } @@ -2575,7 +2577,8 @@ "end": { "line": 12, "column": 39 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/es2015/modules/export-default-function-declaration-expression-disambiguation/expected.json b/test/fixtures/es2015/modules/export-default-function-declaration-expression-disambiguation/expected.json index 499e822973..8106cf01a0 100644 --- a/test/fixtures/es2015/modules/export-default-function-declaration-expression-disambiguation/expected.json +++ b/test/fixtures/es2015/modules/export-default-function-declaration-expression-disambiguation/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -105,11 +106,13 @@ "end": { "line": 2, "column": 4 - } + }, + "identifierName": "foo" }, "name": "foo", "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 30 } } } diff --git a/test/fixtures/es2015/modules/export-default-function-declaration/expected.json b/test/fixtures/es2015/modules/export-default-function-declaration/expected.json index 182219d69c..ffc9c92fd4 100644 --- a/test/fixtures/es2015/modules/export-default-function-declaration/expected.json +++ b/test/fixtures/es2015/modules/export-default-function-declaration/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "a" }, "name": "a" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -89,10 +91,12 @@ "column": 30 } }, - "body": [] + "body": [], + "directives": [] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/es2015/modules/export-default-function-expression/expected.json b/test/fixtures/es2015/modules/export-default-function-expression/expected.json index a83ccafb0b..845de0632b 100644 --- a/test/fixtures/es2015/modules/export-default-function-expression/expected.json +++ b/test/fixtures/es2015/modules/export-default-function-expression/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "a" }, "name": "a" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -93,7 +95,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 15 } } } diff --git a/test/fixtures/es2015/regression/186/expected.json b/test/fixtures/es2015/regression/186/expected.json index fc3a010f4e..080e9bbb8d 100644 --- a/test/fixtures/es2015/regression/186/expected.json +++ b/test/fixtures/es2015/regression/186/expected.json @@ -122,6 +122,7 @@ }, "name": "async" }, + "computed": false, "value": { "type": "Identifier", "start": 11, diff --git a/test/fixtures/es2015/uncategorised/.191/expected.json b/test/fixtures/es2015/uncategorised/.191/expected.json deleted file mode 100644 index 2b36873e36..0000000000 --- a/test/fixtures/es2015/uncategorised/.191/expected.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "id": { - "type": "ArrayPattern", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "elements": [ - { - "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "name": "a" - }, - { - "type": "RestElement", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "argument": { - "type": "ArrayPattern", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "elements": [ - { - "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "name": "b" - }, - { - "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "name": "c" - } - ] - } - } - ] - }, - "init": { - "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "name": "d" - } - } - ], - "kind": "var" - } - ] - }, - "comments": [] -} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/.335/expected.json b/test/fixtures/es2015/uncategorised/.335/expected.json deleted file mode 100644 index 5e726736c7..0000000000 --- a/test/fixtures/es2015/uncategorised/.335/expected.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "id": { - "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "name": "y" - }, - "generator": true, - "expression": false, - "params": [ - { - "type": "ObjectPattern", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "properties": [ - { - "type": "Property", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "yield" - }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "yield" - } - } - ] - } - ], - "body": { - "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "body": [] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/.343/expected.json b/test/fixtures/es2015/uncategorised/.343/expected.json deleted file mode 100644 index dd64dc845d..0000000000 --- a/test/fixtures/es2015/uncategorised/.343/expected.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "expression": { - "type": "Literal", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "raw": "/\\u{110000}/u", - "regex": { - "pattern": "\\u{110000}", - "flags": "u" - } - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/100/expected.json b/test/fixtures/es2015/uncategorised/100/expected.json index 6cf9d34539..dca7e84e4b 100644 --- a/test/fixtures/es2015/uncategorised/100/expected.json +++ b/test/fixtures/es2015/uncategorised/100/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -133,7 +134,8 @@ "end": { "line": 2, "column": 1 - } + }, + "identifierName": "v" }, "name": "v" } @@ -142,7 +144,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/101/expected.json b/test/fixtures/es2015/uncategorised/101/expected.json index 474fa746b1..19da0b61bb 100644 --- a/test/fixtures/es2015/uncategorised/101/expected.json +++ b/test/fixtures/es2015/uncategorised/101/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,7 +117,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "v" }, "name": "v" } @@ -126,7 +128,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/102/expected.json b/test/fixtures/es2015/uncategorised/102/expected.json index 313a50f769..44a42a67a3 100644 --- a/test/fixtures/es2015/uncategorised/102/expected.json +++ b/test/fixtures/es2015/uncategorised/102/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "test" }, "name": "test" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,16 +119,18 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "v" }, "name": "v" } } } - ] + ], + "directives": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/103/expected.json b/test/fixtures/es2015/uncategorised/103/expected.json index 1397cc5c38..fc3feab5f7 100644 --- a/test/fixtures/es2015/uncategorised/103/expected.json +++ b/test/fixtures/es2015/uncategorised/103/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "test" }, "name": "test" }, @@ -125,6 +127,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -182,7 +185,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "v" }, "name": "v" } diff --git a/test/fixtures/es2015/uncategorised/104/expected.json b/test/fixtures/es2015/uncategorised/104/expected.json index 953225b56f..c06f76fd9b 100644 --- a/test/fixtures/es2015/uncategorised/104/expected.json +++ b/test/fixtures/es2015/uncategorised/104/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -130,7 +132,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "console" }, "name": "console" }, @@ -146,7 +149,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "log" }, "name": "log" }, @@ -173,9 +177,11 @@ ] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/105/expected.json b/test/fixtures/es2015/uncategorised/105/expected.json index cf48cd61b8..a9aed1c3aa 100644 --- a/test/fixtures/es2015/uncategorised/105/expected.json +++ b/test/fixtures/es2015/uncategorised/105/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "t" }, "name": "t" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -75,10 +77,11 @@ "column": 16 } }, - "body": [] + "body": [], + "directives": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/106/expected.json b/test/fixtures/es2015/uncategorised/106/expected.json index 375a738193..d31bc5cfdb 100644 --- a/test/fixtures/es2015/uncategorised/106/expected.json +++ b/test/fixtures/es2015/uncategorised/106/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -146,7 +147,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/107/expected.json b/test/fixtures/es2015/uncategorised/107/expected.json index 0b5fab146f..80d2b3dc47 100644 --- a/test/fixtures/es2015/uncategorised/107/expected.json +++ b/test/fixtures/es2015/uncategorised/107/expected.json @@ -42,6 +42,7 @@ "column": 26 } }, + "await": false, "left": { "type": "Identifier", "start": 4, @@ -54,7 +55,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -70,7 +72,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -114,7 +117,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -131,7 +135,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "x" }, "name": "x" } @@ -139,7 +144,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/108/expected.json b/test/fixtures/es2015/uncategorised/108/expected.json index 135f7e34c7..b14f0cd72e 100644 --- a/test/fixtures/es2015/uncategorised/108/expected.json +++ b/test/fixtures/es2015/uncategorised/108/expected.json @@ -42,6 +42,7 @@ "column": 31 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -148,7 +151,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -165,7 +169,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "x" }, "name": "x" } @@ -173,7 +178,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/110/expected.json b/test/fixtures/es2015/uncategorised/110/expected.json index 121d7f9753..cbcba6f392 100644 --- a/test/fixtures/es2015/uncategorised/110/expected.json +++ b/test/fixtures/es2015/uncategorised/110/expected.json @@ -42,6 +42,7 @@ "column": 31 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -148,7 +151,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -165,7 +169,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "x" }, "name": "x" } @@ -173,7 +178,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/111/expected.json b/test/fixtures/es2015/uncategorised/111/expected.json index 4f7aa5c5a4..d9d53207f6 100644 --- a/test/fixtures/es2015/uncategorised/111/expected.json +++ b/test/fixtures/es2015/uncategorised/111/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -100,7 +101,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -125,7 +127,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/112/expected.json b/test/fixtures/es2015/uncategorised/112/expected.json index 0a8f8339c4..8a601083eb 100644 --- a/test/fixtures/es2015/uncategorised/112/expected.json +++ b/test/fixtures/es2015/uncategorised/112/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -100,7 +102,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "C" }, "name": "C" }, @@ -138,7 +141,7 @@ "body": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/113/expected.json b/test/fixtures/es2015/uncategorised/113/expected.json index d5b033e029..cad16d40f7 100644 --- a/test/fixtures/es2015/uncategorised/113/expected.json +++ b/test/fixtures/es2015/uncategorised/113/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 17 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "get" }, "name": "get" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/114/expected.json b/test/fixtures/es2015/uncategorised/114/expected.json index 6601d59d6d..8af6dc0f92 100644 --- a/test/fixtures/es2015/uncategorised/114/expected.json +++ b/test/fixtures/es2015/uncategorised/114/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 25 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "get" }, "name": "get" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/115/expected.json b/test/fixtures/es2015/uncategorised/115/expected.json index 75c400a2a7..17580d67f8 100644 --- a/test/fixtures/es2015/uncategorised/115/expected.json +++ b/test/fixtures/es2015/uncategorised/115/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -70,7 +71,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -103,6 +105,7 @@ "column": 31 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -116,15 +119,16 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/116/expected.json b/test/fixtures/es2015/uncategorised/116/expected.json index c3fa277a2f..1296990414 100644 --- a/test/fixtures/es2015/uncategorised/116/expected.json +++ b/test/fixtures/es2015/uncategorised/116/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -70,7 +71,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -103,6 +105,7 @@ "column": 39 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -116,15 +119,16 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/117/expected.json b/test/fixtures/es2015/uncategorised/117/expected.json index d607a58aad..f00e0c107d 100644 --- a/test/fixtures/es2015/uncategorised/117/expected.json +++ b/test/fixtures/es2015/uncategorised/117/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 20 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": false, "kind": "set", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -123,7 +126,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "v" }, "name": "v" } diff --git a/test/fixtures/es2015/uncategorised/118/expected.json b/test/fixtures/es2015/uncategorised/118/expected.json index 54e7adf346..312d1c4e77 100644 --- a/test/fixtures/es2015/uncategorised/118/expected.json +++ b/test/fixtures/es2015/uncategorised/118/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 28 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": true, "kind": "set", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -123,7 +126,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "v" }, "name": "v" } diff --git a/test/fixtures/es2015/uncategorised/119/expected.json b/test/fixtures/es2015/uncategorised/119/expected.json index e47c5c6942..622579925b 100644 --- a/test/fixtures/es2015/uncategorised/119/expected.json +++ b/test/fixtures/es2015/uncategorised/119/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 18 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "set" }, "name": "set" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -123,7 +126,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "v" }, "name": "v" } diff --git a/test/fixtures/es2015/uncategorised/120/expected.json b/test/fixtures/es2015/uncategorised/120/expected.json index 873df88c9f..6159a166d3 100644 --- a/test/fixtures/es2015/uncategorised/120/expected.json +++ b/test/fixtures/es2015/uncategorised/120/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 26 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "set" }, "name": "set" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -123,7 +126,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "v" }, "name": "v" } diff --git a/test/fixtures/es2015/uncategorised/121/expected.json b/test/fixtures/es2015/uncategorised/121/expected.json index f1e8a83082..9dbb7f0244 100644 --- a/test/fixtures/es2015/uncategorised/121/expected.json +++ b/test/fixtures/es2015/uncategorised/121/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,8 @@ "column": 29 } }, + "static": false, + "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -101,15 +104,15 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "gen" }, "name": "gen" }, - "static": false, - "kind": "method", "id": null, "generator": true, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -123,7 +126,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "v" }, "name": "v" } @@ -184,7 +188,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "v" }, "name": "v" } diff --git a/test/fixtures/es2015/uncategorised/122/expected.json b/test/fixtures/es2015/uncategorised/122/expected.json index 0c6728f1b8..df6337f1f3 100644 --- a/test/fixtures/es2015/uncategorised/122/expected.json +++ b/test/fixtures/es2015/uncategorised/122/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,8 @@ "column": 37 } }, + "static": true, + "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -101,15 +104,15 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "gen" }, "name": "gen" }, - "static": true, - "kind": "method", "id": null, "generator": true, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -123,7 +126,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "v" }, "name": "v" } @@ -184,7 +188,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "v" }, "name": "v" } diff --git a/test/fixtures/es2015/uncategorised/123/expected.json b/test/fixtures/es2015/uncategorised/123/expected.json index 2b8ddddaf7..1685cc9b6e 100644 --- a/test/fixtures/es2015/uncategorised/123/expected.json +++ b/test/fixtures/es2015/uncategorised/123/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -102,6 +103,7 @@ "column": 49 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -115,15 +117,16 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "constructor" }, "name": "constructor" }, - "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -193,7 +196,8 @@ ] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 14 } } } diff --git a/test/fixtures/es2015/uncategorised/124/expected.json b/test/fixtures/es2015/uncategorised/124/expected.json index 7c01cad6f1..264271977f 100644 --- a/test/fixtures/es2015/uncategorised/124/expected.json +++ b/test/fixtures/es2015/uncategorised/124/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 27 } }, + "static": false, "computed": false, "key": { "type": "StringLiteral", @@ -109,11 +111,11 @@ }, "value": "constructor" }, - "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/128/expected.json b/test/fixtures/es2015/uncategorised/128/expected.json index 937272b468..fc2058a420 100644 --- a/test/fixtures/es2015/uncategorised/128/expected.json +++ b/test/fixtures/es2015/uncategorised/128/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 24 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/129/expected.json b/test/fixtures/es2015/uncategorised/129/expected.json index bb30c8aa84..5454ccebf1 100644 --- a/test/fixtures/es2015/uncategorised/129/expected.json +++ b/test/fixtures/es2015/uncategorised/129/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 17 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 33 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/131/expected.json b/test/fixtures/es2015/uncategorised/131/expected.json index 8c38e200c5..ec906dfe00 100644 --- a/test/fixtures/es2015/uncategorised/131/expected.json +++ b/test/fixtures/es2015/uncategorised/131/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 18 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 27 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/132/expected.json b/test/fixtures/es2015/uncategorised/132/expected.json index 7468edee54..2dd984cc0f 100644 --- a/test/fixtures/es2015/uncategorised/132/expected.json +++ b/test/fixtures/es2015/uncategorised/132/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 22 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 36 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "set", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -178,7 +183,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "v" }, "name": "v" } diff --git a/test/fixtures/es2015/uncategorised/133/expected.json b/test/fixtures/es2015/uncategorised/133/expected.json index 7e8a2075c5..199a299f92 100644 --- a/test/fixtures/es2015/uncategorised/133/expected.json +++ b/test/fixtures/es2015/uncategorised/133/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 29 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 42 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/134/expected.json b/test/fixtures/es2015/uncategorised/134/expected.json index d81ed33228..b9dd2520bd 100644 --- a/test/fixtures/es2015/uncategorised/134/expected.json +++ b/test/fixtures/es2015/uncategorised/134/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 29 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 49 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 44 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": true, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/135/expected.json b/test/fixtures/es2015/uncategorised/135/expected.json index 834c4dccf7..903738ff2c 100644 --- a/test/fixtures/es2015/uncategorised/135/expected.json +++ b/test/fixtures/es2015/uncategorised/135/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 29 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 50 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 44 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "kind": "set", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -178,7 +183,8 @@ "end": { "line": 1, "column": 46 - } + }, + "identifierName": "v" }, "name": "v" } @@ -215,6 +221,7 @@ "column": 63 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -228,15 +235,16 @@ "end": { "line": 1, "column": 58 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -270,6 +278,7 @@ "column": 77 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -283,15 +292,16 @@ "end": { "line": 1, "column": 71 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "set", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -305,7 +315,8 @@ "end": { "line": 1, "column": 73 - } + }, + "identifierName": "v" }, "name": "v" } diff --git a/test/fixtures/es2015/uncategorised/136/expected.json b/test/fixtures/es2015/uncategorised/136/expected.json index 22216e8a4d..c01494b7de 100644 --- a/test/fixtures/es2015/uncategorised/136/expected.json +++ b/test/fixtures/es2015/uncategorised/136/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 27 } }, + "static": true, "computed": true, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/137/expected.json b/test/fixtures/es2015/uncategorised/137/expected.json index 379914b948..0864f451f7 100644 --- a/test/fixtures/es2015/uncategorised/137/expected.json +++ b/test/fixtures/es2015/uncategorised/137/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 31 } }, + "static": true, "computed": true, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/138/expected.json b/test/fixtures/es2015/uncategorised/138/expected.json index 36e95c1207..e8baafdc74 100644 --- a/test/fixtures/es2015/uncategorised/138/expected.json +++ b/test/fixtures/es2015/uncategorised/138/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 23 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "set", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -123,7 +126,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "v" }, "name": "v" } @@ -160,6 +164,7 @@ "column": 36 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -173,15 +178,16 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/139/expected.json b/test/fixtures/es2015/uncategorised/139/expected.json index ada61eb661..b61e6d560f 100644 --- a/test/fixtures/es2015/uncategorised/139/expected.json +++ b/test/fixtures/es2015/uncategorised/139/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 18 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 31 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/140/expected.json b/test/fixtures/es2015/uncategorised/140/expected.json index bb91764245..54d6adf996 100644 --- a/test/fixtures/es2015/uncategorised/140/expected.json +++ b/test/fixtures/es2015/uncategorised/140/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "Semicolon" }, "name": "Semicolon" }, @@ -76,7 +77,7 @@ "body": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/141/expected.json b/test/fixtures/es2015/uncategorised/141/expected.json index d5c3f29651..eddaee3cad 100644 --- a/test/fixtures/es2015/uncategorised/141/expected.json +++ b/test/fixtures/es2015/uncategorised/141/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -113,7 +114,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/142/expected.json b/test/fixtures/es2015/uncategorised/142/expected.json index f32ac33468..15b8f684ff 100644 --- a/test/fixtures/es2015/uncategorised/142/expected.json +++ b/test/fixtures/es2015/uncategorised/142/expected.json @@ -153,7 +153,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/143/expected.json b/test/fixtures/es2015/uncategorised/143/expected.json index cc0ab8afc8..aaa1c78fe5 100644 --- a/test/fixtures/es2015/uncategorised/143/expected.json +++ b/test/fixtures/es2015/uncategorised/143/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -107,6 +108,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -129,7 +131,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/144/expected.json b/test/fixtures/es2015/uncategorised/144/expected.json index 50af14c530..3e8c0bd2cf 100644 --- a/test/fixtures/es2015/uncategorised/144/expected.json +++ b/test/fixtures/es2015/uncategorised/144/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -140,7 +141,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -167,7 +169,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/145/expected.json b/test/fixtures/es2015/uncategorised/145/expected.json index c87f359ecb..39d0f02fc4 100644 --- a/test/fixtures/es2015/uncategorised/145/expected.json +++ b/test/fixtures/es2015/uncategorised/145/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -94,6 +95,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -142,7 +144,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -150,6 +153,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -163,7 +167,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "v" }, "name": "v" } @@ -188,7 +193,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/146/expected.json b/test/fixtures/es2015/uncategorised/146/expected.json index 8ab9dd27fd..7c8df52528 100644 --- a/test/fixtures/es2015/uncategorised/146/expected.json +++ b/test/fixtures/es2015/uncategorised/146/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -94,6 +95,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,7 +117,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/147/expected.json b/test/fixtures/es2015/uncategorised/147/expected.json index e9263cf600..3605b59b78 100644 --- a/test/fixtures/es2015/uncategorised/147/expected.json +++ b/test/fixtures/es2015/uncategorised/147/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "y" }, "name": "y" } @@ -168,7 +170,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -184,9 +187,13 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "y" }, "name": "y" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/148/expected.json b/test/fixtures/es2015/uncategorised/148/expected.json index c2c6fcf107..dfea488504 100644 --- a/test/fixtures/es2015/uncategorised/148/expected.json +++ b/test/fixtures/es2015/uncategorised/148/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -105,7 +107,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -121,7 +124,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/es2015/uncategorised/149/expected.json b/test/fixtures/es2015/uncategorised/149/expected.json index 2b533c4b95..531feae88a 100644 --- a/test/fixtures/es2015/uncategorised/149/expected.json +++ b/test/fixtures/es2015/uncategorised/149/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "test" }, "name": "test" }, @@ -125,6 +127,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -182,7 +185,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "v" }, "name": "v" } diff --git a/test/fixtures/es2015/uncategorised/150/expected.json b/test/fixtures/es2015/uncategorised/150/expected.json index 77889bf067..2e9d46b456 100644 --- a/test/fixtures/es2015/uncategorised/150/expected.json +++ b/test/fixtures/es2015/uncategorised/150/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 17 } }, + "static": false, "computed": true, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "x" }, "name": "x" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/152/expected.json b/test/fixtures/es2015/uncategorised/152/expected.json index 19aeb74f7d..4577cf0204 100644 --- a/test/fixtures/es2015/uncategorised/152/expected.json +++ b/test/fixtures/es2015/uncategorised/152/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -102,7 +104,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" } diff --git a/test/fixtures/es2015/uncategorised/153/expected.json b/test/fixtures/es2015/uncategorised/153/expected.json index 2d01d0b275..2876aa00ee 100644 --- a/test/fixtures/es2015/uncategorised/153/expected.json +++ b/test/fixtures/es2015/uncategorised/153/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -119,7 +121,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -135,9 +138,13 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } } ] @@ -186,7 +193,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/es2015/uncategorised/154/expected.json b/test/fixtures/es2015/uncategorised/154/expected.json index 371e5cb174..47be23ad0b 100644 --- a/test/fixtures/es2015/uncategorised/154/expected.json +++ b/test/fixtures/es2015/uncategorised/154/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -149,7 +151,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -165,9 +168,13 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } } ] @@ -216,7 +223,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/es2015/uncategorised/155/expected.json b/test/fixtures/es2015/uncategorised/155/expected.json index 8ba65a825d..40fd9771cf 100644 --- a/test/fixtures/es2015/uncategorised/155/expected.json +++ b/test/fixtures/es2015/uncategorised/155/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -107,6 +108,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -166,7 +168,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -182,9 +185,13 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } } ] @@ -233,7 +240,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -283,7 +291,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/156/expected.json b/test/fixtures/es2015/uncategorised/156/expected.json index 44938263b8..287d7e8771 100644 --- a/test/fixtures/es2015/uncategorised/156/expected.json +++ b/test/fixtures/es2015/uncategorised/156/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -94,6 +95,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -153,7 +155,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -169,9 +172,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } } ] @@ -220,7 +227,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -269,7 +277,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/157/expected.json b/test/fixtures/es2015/uncategorised/157/expected.json index 247de16217..6075b1827f 100644 --- a/test/fixtures/es2015/uncategorised/157/expected.json +++ b/test/fixtures/es2015/uncategorised/157/expected.json @@ -87,6 +87,7 @@ "column": 27 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -100,15 +101,16 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "f" }, "name": "f" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -168,7 +170,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -184,9 +187,13 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } } ] @@ -235,7 +242,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -285,7 +293,8 @@ ] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/158/expected.json b/test/fixtures/es2015/uncategorised/158/expected.json index f5d344c43a..88d65a30fb 100644 --- a/test/fixtures/es2015/uncategorised/158/expected.json +++ b/test/fixtures/es2015/uncategorised/158/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -118,7 +119,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -134,9 +136,13 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } } ] @@ -185,7 +191,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -232,7 +239,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/159/expected.json b/test/fixtures/es2015/uncategorised/159/expected.json index 62a790d784..e1465d0c7d 100644 --- a/test/fixtures/es2015/uncategorised/159/expected.json +++ b/test/fixtures/es2015/uncategorised/159/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "y" }, "name": "y" }, diff --git a/test/fixtures/es2015/uncategorised/160/expected.json b/test/fixtures/es2015/uncategorised/160/expected.json index b6a422f551..a0c1096c6f 100644 --- a/test/fixtures/es2015/uncategorised/160/expected.json +++ b/test/fixtures/es2015/uncategorised/160/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -87,7 +89,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/es2015/uncategorised/161/expected.json b/test/fixtures/es2015/uncategorised/161/expected.json index 71590f27e6..9d6157c40e 100644 --- a/test/fixtures/es2015/uncategorised/161/expected.json +++ b/test/fixtures/es2015/uncategorised/161/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -138,6 +140,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -165,7 +168,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/es2015/uncategorised/162/expected.json b/test/fixtures/es2015/uncategorised/162/expected.json index a1ce797365..7d167b78cf 100644 --- a/test/fixtures/es2015/uncategorised/162/expected.json +++ b/test/fixtures/es2015/uncategorised/162/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -152,7 +155,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/es2015/uncategorised/163/expected.json b/test/fixtures/es2015/uncategorised/163/expected.json index ec815ca77b..07716be5ae 100644 --- a/test/fixtures/es2015/uncategorised/163/expected.json +++ b/test/fixtures/es2015/uncategorised/163/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -103,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "b" }, "name": "b" } @@ -123,10 +127,11 @@ "column": 22 } }, - "body": [] + "body": [], + "directives": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/164/expected.json b/test/fixtures/es2015/uncategorised/164/expected.json index 6cf3d81740..a42e8c8b1d 100644 --- a/test/fixtures/es2015/uncategorised/164/expected.json +++ b/test/fixtures/es2015/uncategorised/164/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ArrayPattern", @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -104,7 +107,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "b" }, "name": "b" } @@ -125,10 +129,11 @@ "column": 22 } }, - "body": [] + "body": [], + "directives": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/165/expected.json b/test/fixtures/es2015/uncategorised/165/expected.json index 08cb8d6662..f6be853aa4 100644 --- a/test/fixtures/es2015/uncategorised/165/expected.json +++ b/test/fixtures/es2015/uncategorised/165/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -105,7 +107,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -121,9 +124,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } }, { @@ -155,7 +162,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -171,9 +179,13 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "b" }, "name": "b" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/166/expected.json b/test/fixtures/es2015/uncategorised/166/expected.json index fecc14e44a..4d1f380f71 100644 --- a/test/fixtures/es2015/uncategorised/166/expected.json +++ b/test/fixtures/es2015/uncategorised/166/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -121,7 +124,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -137,9 +141,13 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/169/expected.json b/test/fixtures/es2015/uncategorised/169/expected.json index 7aa4a008d7..349715bcfa 100644 --- a/test/fixtures/es2015/uncategorised/169/expected.json +++ b/test/fixtures/es2015/uncategorised/169/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "x" }, "name": "x" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ArrayPattern", @@ -102,7 +104,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -118,7 +121,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "b" }, "name": "b" } @@ -143,7 +147,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/170/expected.json b/test/fixtures/es2015/uncategorised/170/expected.json index 50b9811fd9..4053df70fa 100644 --- a/test/fixtures/es2015/uncategorised/170/expected.json +++ b/test/fixtures/es2015/uncategorised/170/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "x" }, "name": "x" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -119,7 +121,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -135,9 +138,13 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } }, { @@ -169,7 +176,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -185,9 +193,13 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "b" }, "name": "b" + }, + "extra": { + "shorthand": true } } ] @@ -211,7 +223,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/173/expected.json b/test/fixtures/es2015/uncategorised/173/expected.json index 35b8ef2474..8cbad3c24a 100644 --- a/test/fixtures/es2015/uncategorised/173/expected.json +++ b/test/fixtures/es2015/uncategorised/173/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -94,6 +95,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ArrayPattern", @@ -122,7 +124,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -138,7 +141,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "b" }, "name": "b" } @@ -165,7 +169,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/176/expected.json b/test/fixtures/es2015/uncategorised/176/expected.json index 00ea0f3c2a..a8af6c1f54 100644 --- a/test/fixtures/es2015/uncategorised/176/expected.json +++ b/test/fixtures/es2015/uncategorised/176/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "RestElement", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" } @@ -106,11 +108,12 @@ "column": 12 } }, - "body": [] + "body": [], + "directives": [] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/177/expected.json b/test/fixtures/es2015/uncategorised/177/expected.json index 4051c8ff14..b6621bcdef 100644 --- a/test/fixtures/es2015/uncategorised/177/expected.json +++ b/test/fixtures/es2015/uncategorised/177/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -102,7 +104,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" } @@ -122,11 +125,12 @@ "column": 15 } }, - "body": [] + "body": [], + "directives": [] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/178/expected.json b/test/fixtures/es2015/uncategorised/178/expected.json index 15f1e7078a..1019f36221 100644 --- a/test/fixtures/es2015/uncategorised/178/expected.json +++ b/test/fixtures/es2015/uncategorised/178/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -120,9 +122,13 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/179/expected.json b/test/fixtures/es2015/uncategorised/179/expected.json index ce3a65a9ee..1483adeab3 100644 --- a/test/fixtures/es2015/uncategorised/179/expected.json +++ b/test/fixtures/es2015/uncategorised/179/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -120,9 +122,13 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } } ] @@ -153,7 +159,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/es2015/uncategorised/18/expected.json b/test/fixtures/es2015/uncategorised/18/expected.json index 066751d992..ad16fe02ef 100644 --- a/test/fixtures/es2015/uncategorised/18/expected.json +++ b/test/fixtures/es2015/uncategorised/18/expected.json @@ -81,7 +81,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/182/expected.json b/test/fixtures/es2015/uncategorised/182/expected.json index 35cdf77789..403a007d36 100644 --- a/test/fixtures/es2015/uncategorised/182/expected.json +++ b/test/fixtures/es2015/uncategorised/182/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -135,7 +137,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -151,7 +154,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "b" }, "name": "b" } @@ -186,7 +190,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "c" }, "name": "c" } diff --git a/test/fixtures/es2015/uncategorised/183/expected.json b/test/fixtures/es2015/uncategorised/183/expected.json index 79bc67b569..e6a04cd66b 100644 --- a/test/fixtures/es2015/uncategorised/183/expected.json +++ b/test/fixtures/es2015/uncategorised/183/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -120,7 +122,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "b" }, "name": "b" } @@ -154,7 +157,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "c" }, "name": "c" }, @@ -170,9 +174,13 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "c" }, "name": "c" + }, + "extra": { + "shorthand": true } } ] @@ -204,7 +212,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "d" }, "name": "d" }, @@ -220,7 +229,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "e" }, "name": "e" } @@ -252,7 +262,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "f" }, "name": "f" } diff --git a/test/fixtures/es2015/uncategorised/184/expected.json b/test/fixtures/es2015/uncategorised/184/expected.json index ce8b5406ef..ba02725ad0 100644 --- a/test/fixtures/es2015/uncategorised/184/expected.json +++ b/test/fixtures/es2015/uncategorised/184/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" } @@ -117,13 +118,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "b" }, "name": "b" } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/185/expected.json b/test/fixtures/es2015/uncategorised/185/expected.json index 7876d116e8..ed0b4ee13d 100644 --- a/test/fixtures/es2015/uncategorised/185/expected.json +++ b/test/fixtures/es2015/uncategorised/185/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" } @@ -133,13 +135,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "c" }, "name": "c" } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/186/expected.json b/test/fixtures/es2015/uncategorised/186/expected.json index 16d0a3f561..6164999ca8 100644 --- a/test/fixtures/es2015/uncategorised/186/expected.json +++ b/test/fixtures/es2015/uncategorised/186/expected.json @@ -116,7 +116,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -132,9 +133,13 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } }, { @@ -166,7 +171,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -182,9 +188,13 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "b" }, "name": "b" + }, + "extra": { + "shorthand": true } } ] @@ -215,7 +225,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "c" }, "name": "c" } @@ -234,7 +245,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "d" }, "name": "d" } diff --git a/test/fixtures/es2015/uncategorised/187/expected.json b/test/fixtures/es2015/uncategorised/187/expected.json index 89c48e2bde..6c7430e634 100644 --- a/test/fixtures/es2015/uncategorised/187/expected.json +++ b/test/fixtures/es2015/uncategorised/187/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -129,7 +130,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -145,7 +147,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "c" }, "name": "c" } @@ -166,13 +169,14 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "d" }, "name": "d" } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/188/expected.json b/test/fixtures/es2015/uncategorised/188/expected.json index ae113e8e2d..3e27df2792 100644 --- a/test/fixtures/es2015/uncategorised/188/expected.json +++ b/test/fixtures/es2015/uncategorised/188/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "a" }, "name": "a" } @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "b" }, "name": "b" } @@ -125,7 +127,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/189/expected.json b/test/fixtures/es2015/uncategorised/189/expected.json index abe4eaeff9..11ca896f80 100644 --- a/test/fixtures/es2015/uncategorised/189/expected.json +++ b/test/fixtures/es2015/uncategorised/189/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "b" }, "name": "b" } @@ -133,7 +135,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "c" }, "name": "c" } @@ -141,7 +144,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/19/expected.json b/test/fixtures/es2015/uncategorised/19/expected.json index dcf190a44c..6b4305de3b 100644 --- a/test/fixtures/es2015/uncategorised/19/expected.json +++ b/test/fixtures/es2015/uncategorised/19/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "raw" }, "name": "raw" }, @@ -112,7 +113,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/190/expected.json b/test/fixtures/es2015/uncategorised/190/expected.json index dc0dd1b374..2968812946 100644 --- a/test/fixtures/es2015/uncategorised/190/expected.json +++ b/test/fixtures/es2015/uncategorised/190/expected.json @@ -116,7 +116,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -132,9 +133,13 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } }, { @@ -166,7 +171,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -182,9 +188,13 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "b" }, "name": "b" + }, + "extra": { + "shorthand": true } } ] @@ -215,7 +225,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "c" }, "name": "c" } @@ -234,7 +245,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "d" }, "name": "d" } diff --git a/test/fixtures/es2015/uncategorised/192/expected.json b/test/fixtures/es2015/uncategorised/192/expected.json index 0b70371d47..c644dc8e95 100644 --- a/test/fixtures/es2015/uncategorised/192/expected.json +++ b/test/fixtures/es2015/uncategorised/192/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "func" }, "name": "func" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "a" }, "name": "a" } @@ -107,7 +109,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/193/expected.json b/test/fixtures/es2015/uncategorised/193/expected.json index 98f7082d88..80d1838cd2 100644 --- a/test/fixtures/es2015/uncategorised/193/expected.json +++ b/test/fixtures/es2015/uncategorised/193/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "func" }, "name": "func" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -115,7 +117,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "b" }, "name": "b" } @@ -123,7 +126,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/194/expected.json b/test/fixtures/es2015/uncategorised/194/expected.json index 8c0a47724f..1339fd84db 100644 --- a/test/fixtures/es2015/uncategorised/194/expected.json +++ b/test/fixtures/es2015/uncategorised/194/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "func" }, "name": "func" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "a" }, "name": "a" } @@ -116,14 +118,15 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "b" }, "name": "b" } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/197/expected.json b/test/fixtures/es2015/uncategorised/197/expected.json index ca35fe564c..7d10bbaad4 100644 --- a/test/fixtures/es2015/uncategorised/197/expected.json +++ b/test/fixtures/es2015/uncategorised/197/expected.json @@ -116,7 +116,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "foo" }, "name": "foo" }, diff --git a/test/fixtures/es2015/uncategorised/20/expected.json b/test/fixtures/es2015/uncategorised/20/expected.json index 245e390fe6..9b083f0902 100644 --- a/test/fixtures/es2015/uncategorised/20/expected.json +++ b/test/fixtures/es2015/uncategorised/20/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "raw" }, "name": "raw" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "name" }, "name": "name" } @@ -149,7 +151,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/21/expected.json b/test/fixtures/es2015/uncategorised/21/expected.json index 6f192feca1..8b41104a7b 100644 --- a/test/fixtures/es2015/uncategorised/21/expected.json +++ b/test/fixtures/es2015/uncategorised/21/expected.json @@ -81,7 +81,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/22/expected.json b/test/fixtures/es2015/uncategorised/22/expected.json index a0a63138db..9946fcaf1d 100644 --- a/test/fixtures/es2015/uncategorised/22/expected.json +++ b/test/fixtures/es2015/uncategorised/22/expected.json @@ -81,7 +81,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/23/expected.json b/test/fixtures/es2015/uncategorised/23/expected.json index f02b70e9aa..61a17dec4f 100644 --- a/test/fixtures/es2015/uncategorised/23/expected.json +++ b/test/fixtures/es2015/uncategorised/23/expected.json @@ -81,7 +81,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/24/expected.json b/test/fixtures/es2015/uncategorised/24/expected.json index fb84640ac8..6c38d1e510 100644 --- a/test/fixtures/es2015/uncategorised/24/expected.json +++ b/test/fixtures/es2015/uncategorised/24/expected.json @@ -81,7 +81,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/25/expected.json b/test/fixtures/es2015/uncategorised/25/expected.json index 483c9211ab..76377676ec 100644 --- a/test/fixtures/es2015/uncategorised/25/expected.json +++ b/test/fixtures/es2015/uncategorised/25/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "raw" }, "name": "raw" }, @@ -128,7 +129,7 @@ "arguments": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/256/expected.json b/test/fixtures/es2015/uncategorised/256/expected.json index 2420931359..f9d81e9d99 100644 --- a/test/fixtures/es2015/uncategorised/256/expected.json +++ b/test/fixtures/es2015/uncategorised/256/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "yield" }, "name": "yield" }, diff --git a/test/fixtures/es2015/uncategorised/257/expected.json b/test/fixtures/es2015/uncategorised/257/expected.json index 86d0362c7a..177e044e8d 100644 --- a/test/fixtures/es2015/uncategorised/257/expected.json +++ b/test/fixtures/es2015/uncategorised/257/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "e" }, "name": "e" } @@ -103,7 +105,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "yield" }, "name": "yield" }, diff --git a/test/fixtures/es2015/uncategorised/259/expected.json b/test/fixtures/es2015/uncategorised/259/expected.json index 4984077118..98b14d48e2 100644 --- a/test/fixtures/es2015/uncategorised/259/expected.json +++ b/test/fixtures/es2015/uncategorised/259/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -146,7 +148,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/26/expected.json b/test/fixtures/es2015/uncategorised/26/expected.json index bf79d99f09..b4c0e8bc2d 100644 --- a/test/fixtures/es2015/uncategorised/26/expected.json +++ b/test/fixtures/es2015/uncategorised/26/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -149,7 +150,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -211,6 +213,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/27/expected.json b/test/fixtures/es2015/uncategorised/27/expected.json index 929eaa9eab..5841ab30aa 100644 --- a/test/fixtures/es2015/uncategorised/27/expected.json +++ b/test/fixtures/es2015/uncategorised/27/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "answer" }, "name": "answer" }, @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "t" }, "name": "t" }, diff --git a/test/fixtures/es2015/uncategorised/28/expected.json b/test/fixtures/es2015/uncategorised/28/expected.json index 6b22652418..9910aa18c4 100644 --- a/test/fixtures/es2015/uncategorised/28/expected.json +++ b/test/fixtures/es2015/uncategorised/28/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [], "body": { "type": "StringLiteral", diff --git a/test/fixtures/es2015/uncategorised/29/expected.json b/test/fixtures/es2015/uncategorised/29/expected.json index 070478ffa3..b6a6ef550a 100644 --- a/test/fixtures/es2015/uncategorised/29/expected.json +++ b/test/fixtures/es2015/uncategorised/29/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "e" }, "name": "e" } diff --git a/test/fixtures/es2015/uncategorised/292/expected.json b/test/fixtures/es2015/uncategorised/292/expected.json index c53f6a5581..d0b363d523 100644 --- a/test/fixtures/es2015/uncategorised/292/expected.json +++ b/test/fixtures/es2015/uncategorised/292/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" } @@ -117,13 +118,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "b" }, "name": "b" } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/299/expected.json b/test/fixtures/es2015/uncategorised/299/expected.json index 67a0f6223a..1ba2b86107 100644 --- a/test/fixtures/es2015/uncategorised/299/expected.json +++ b/test/fixtures/es2015/uncategorised/299/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "doSmth" }, "name": "doSmth" }, @@ -100,7 +101,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -146,7 +149,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -163,7 +167,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "y" }, "name": "y" } @@ -255,6 +260,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/30/expected.json b/test/fixtures/es2015/uncategorised/30/expected.json index 71885e218e..0d66821115 100644 --- a/test/fixtures/es2015/uncategorised/30/expected.json +++ b/test/fixtures/es2015/uncategorised/30/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "e" }, "name": "e" } diff --git a/test/fixtures/es2015/uncategorised/300/expected.json b/test/fixtures/es2015/uncategorised/300/expected.json index 928d53b6a0..ac195d7470 100644 --- a/test/fixtures/es2015/uncategorised/300/expected.json +++ b/test/fixtures/es2015/uncategorised/300/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "normal" }, "name": "normal" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -103,7 +106,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "y" }, "name": "y" }, diff --git a/test/fixtures/es2015/uncategorised/301/expected.json b/test/fixtures/es2015/uncategorised/301/expected.json index 2e575ba5c1..f061eeb9cd 100644 --- a/test/fixtures/es2015/uncategorised/301/expected.json +++ b/test/fixtures/es2015/uncategorised/301/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -100,7 +101,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/es2015/uncategorised/302/expected.json b/test/fixtures/es2015/uncategorised/302/expected.json index 835ebf5398..ed08a21975 100644 --- a/test/fixtures/es2015/uncategorised/302/expected.json +++ b/test/fixtures/es2015/uncategorised/302/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" } @@ -173,6 +174,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/303/expected.json b/test/fixtures/es2015/uncategorised/303/expected.json index 64493bca6c..935f87201b 100644 --- a/test/fixtures/es2015/uncategorised/303/expected.json +++ b/test/fixtures/es2015/uncategorised/303/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "get" }, "name": "get" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "get" }, "name": "get" + }, + "extra": { + "shorthand": true } } ] @@ -136,7 +141,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "obj" }, "name": "obj" } diff --git a/test/fixtures/es2015/uncategorised/304/expected.json b/test/fixtures/es2015/uncategorised/304/expected.json index b66e1b6640..28602311f9 100644 --- a/test/fixtures/es2015/uncategorised/304/expected.json +++ b/test/fixtures/es2015/uncategorised/304/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "propName" }, "name": "propName" }, @@ -131,7 +132,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "localVar" }, "name": "localVar" }, @@ -147,7 +149,8 @@ "end": { "line": 1, "column": 38 - } + }, + "identifierName": "defaultValue" }, "name": "defaultValue" } @@ -167,7 +170,8 @@ "end": { "line": 1, "column": 45 - } + }, + "identifierName": "obj" }, "name": "obj" } diff --git a/test/fixtures/es2015/uncategorised/305/expected.json b/test/fixtures/es2015/uncategorised/305/expected.json index 07fa4a6986..2da5b72f13 100644 --- a/test/fixtures/es2015/uncategorised/305/expected.json +++ b/test/fixtures/es2015/uncategorised/305/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "propName" }, "name": "propName" }, @@ -131,7 +132,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "propName" }, "name": "propName" }, @@ -147,10 +149,14 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "defaultValue" }, "name": "defaultValue" } + }, + "extra": { + "shorthand": true } } ] @@ -167,7 +173,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "obj" }, "name": "obj" } diff --git a/test/fixtures/es2015/uncategorised/306/expected.json b/test/fixtures/es2015/uncategorised/306/expected.json index 7a38265d31..6e86c3f9b4 100644 --- a/test/fixtures/es2015/uncategorised/306/expected.json +++ b/test/fixtures/es2015/uncategorised/306/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "localVar" }, "name": "localVar" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "defaultValue" }, "name": "defaultValue" } @@ -133,7 +135,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "obj" }, "name": "obj" } @@ -141,7 +144,7 @@ ], "kind": "var" } - ] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/307/expected.json b/test/fixtures/es2015/uncategorised/307/expected.json index 17da2fe775..b4df0a2a30 100644 --- a/test/fixtures/es2015/uncategorised/307/expected.json +++ b/test/fixtures/es2015/uncategorised/307/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -131,7 +132,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -155,6 +157,9 @@ }, "value": 0 } + }, + "extra": { + "shorthand": true } } ] @@ -171,12 +176,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "obj" }, "name": "obj" }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/308/expected.json b/test/fixtures/es2015/uncategorised/308/expected.json index 1b90586b94..a983e9498e 100644 --- a/test/fixtures/es2015/uncategorised/308/expected.json +++ b/test/fixtures/es2015/uncategorised/308/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "ObjectPattern", @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -134,7 +136,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -158,6 +161,9 @@ }, "value": 0 } + }, + "extra": { + "shorthand": true } } ] @@ -175,7 +181,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "x" }, "name": "x" } diff --git a/test/fixtures/es2015/uncategorised/309/expected.json b/test/fixtures/es2015/uncategorised/309/expected.json index fa310c051a..adf09ef4d3 100644 --- a/test/fixtures/es2015/uncategorised/309/expected.json +++ b/test/fixtures/es2015/uncategorised/309/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -132,7 +133,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -180,7 +182,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "c" }, "name": "c" }, @@ -210,7 +213,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "c" }, "name": "c" }, @@ -234,6 +238,9 @@ }, "value": 1 } + }, + "extra": { + "shorthand": true } } ] @@ -255,7 +262,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "arr" }, "name": "arr" } diff --git a/test/fixtures/es2015/uncategorised/31/expected.json b/test/fixtures/es2015/uncategorised/31/expected.json index 57366e881f..36e04398ee 100644 --- a/test/fixtures/es2015/uncategorised/31/expected.json +++ b/test/fixtures/es2015/uncategorised/31/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/es2015/uncategorised/310/expected.json b/test/fixtures/es2015/uncategorised/310/expected.json index 3c759ccbfc..facb5febd6 100644 --- a/test/fixtures/es2015/uncategorised/310/expected.json +++ b/test/fixtures/es2015/uncategorised/310/expected.json @@ -42,6 +42,7 @@ "column": 21 } }, + "await": false, "left": { "type": "ObjectPattern", "start": 5, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -140,6 +143,9 @@ }, "value": 0 } + }, + "extra": { + "shorthand": true } } ] @@ -156,7 +162,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "arr" }, "name": "arr" }, diff --git a/test/fixtures/es2015/uncategorised/313/expected.json b/test/fixtures/es2015/uncategorised/313/expected.json index 9a9139b799..67a25aed7f 100644 --- a/test/fixtures/es2015/uncategorised/313/expected.json +++ b/test/fixtures/es2015/uncategorised/313/expected.json @@ -117,7 +117,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "message" }, "name": "message" }, @@ -133,9 +134,13 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "message" }, "name": "message" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/314/expected.json b/test/fixtures/es2015/uncategorised/314/expected.json index 859c4a7b48..fbe0b1f788 100644 --- a/test/fixtures/es2015/uncategorised/314/expected.json +++ b/test/fixtures/es2015/uncategorised/314/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,8 @@ "column": 21 } }, + "static": false, + "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -101,15 +104,15 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "static" }, "name": "static" }, - "static": false, - "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/315/expected.json b/test/fixtures/es2015/uncategorised/315/expected.json index a379342239..643da678b1 100644 --- a/test/fixtures/es2015/uncategorised/315/expected.json +++ b/test/fixtures/es2015/uncategorised/315/expected.json @@ -42,6 +42,7 @@ "column": 33 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -148,7 +151,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -165,7 +169,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "x" }, "name": "x" } @@ -173,7 +178,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/316/expected.json b/test/fixtures/es2015/uncategorised/316/expected.json index ec67c88b06..a80e13719d 100644 --- a/test/fixtures/es2015/uncategorised/316/expected.json +++ b/test/fixtures/es2015/uncategorised/316/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,8 @@ "column": 22 } }, + "static": false, + "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -101,15 +104,15 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "static" }, "name": "static" }, - "static": false, - "kind": "method", "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/317/expected.json b/test/fixtures/es2015/uncategorised/317/expected.json index 96d4c0c179..d6851714da 100644 --- a/test/fixtures/es2015/uncategorised/317/expected.json +++ b/test/fixtures/es2015/uncategorised/317/expected.json @@ -131,7 +131,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "exec" }, "name": "exec" }, diff --git a/test/fixtures/es2015/uncategorised/318/expected.json b/test/fixtures/es2015/uncategorised/318/expected.json index 7120ba7201..7359f5f6ed 100644 --- a/test/fixtures/es2015/uncategorised/318/expected.json +++ b/test/fixtures/es2015/uncategorised/318/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "_𐒦" }, "name": "_𐒦" }, diff --git a/test/fixtures/es2015/uncategorised/319/expected.json b/test/fixtures/es2015/uncategorised/319/expected.json index 8c74c8dbfb..5fbbef420e 100644 --- a/test/fixtures/es2015/uncategorised/319/expected.json +++ b/test/fixtures/es2015/uncategorised/319/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "_𐒦" }, "name": "_𐒦" }, diff --git a/test/fixtures/es2015/uncategorised/32/expected.json b/test/fixtures/es2015/uncategorised/32/expected.json index 5644e19a05..54989111af 100644 --- a/test/fixtures/es2015/uncategorised/32/expected.json +++ b/test/fixtures/es2015/uncategorised/32/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "e" }, "name": "e" } diff --git a/test/fixtures/es2015/uncategorised/320/expected.json b/test/fixtures/es2015/uncategorised/320/expected.json index e314fc139a..e543312c78 100644 --- a/test/fixtures/es2015/uncategorised/320/expected.json +++ b/test/fixtures/es2015/uncategorised/320/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" } diff --git a/test/fixtures/es2015/uncategorised/321/expected.json b/test/fixtures/es2015/uncategorised/321/expected.json index 304fea8a0d..0aed7ab433 100644 --- a/test/fixtures/es2015/uncategorised/321/expected.json +++ b/test/fixtures/es2015/uncategorised/321/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } } ] @@ -136,7 +141,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/es2015/uncategorised/322/expected.json b/test/fixtures/es2015/uncategorised/322/expected.json index c8d11ad5e5..5b0a800f93 100644 --- a/test/fixtures/es2015/uncategorised/322/expected.json +++ b/test/fixtures/es2015/uncategorised/322/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/es2015/uncategorised/323/expected.json b/test/fixtures/es2015/uncategorised/323/expected.json index 6473ce385e..158a4615bd 100644 --- a/test/fixtures/es2015/uncategorised/323/expected.json +++ b/test/fixtures/es2015/uncategorised/323/expected.json @@ -42,6 +42,7 @@ "column": 33 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "name" }, "name": "name" }, @@ -114,7 +116,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "value" }, "name": "value" } @@ -137,7 +140,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "obj" }, "name": "obj" }, @@ -155,9 +159,11 @@ "column": 33 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/33/expected.json b/test/fixtures/es2015/uncategorised/33/expected.json index d79ff6492c..0931f56cf1 100644 --- a/test/fixtures/es2015/uncategorised/33/expected.json +++ b/test/fixtures/es2015/uncategorised/33/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "e" }, "name": "e" } @@ -121,7 +123,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "property" }, "name": "property" }, @@ -148,7 +151,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 5 } } } diff --git a/test/fixtures/es2015/uncategorised/338/expected.json b/test/fixtures/es2015/uncategorised/338/expected.json index 909735dfe5..ff0188633a 100644 --- a/test/fixtures/es2015/uncategorised/338/expected.json +++ b/test/fixtures/es2015/uncategorised/338/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/34/expected.json b/test/fixtures/es2015/uncategorised/34/expected.json index a7d846ffb6..93d45404a4 100644 --- a/test/fixtures/es2015/uncategorised/34/expected.json +++ b/test/fixtures/es2015/uncategorised/34/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "e" }, "name": "e" } @@ -153,7 +155,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "label" }, "name": "label" } diff --git a/test/fixtures/es2015/uncategorised/35/expected.json b/test/fixtures/es2015/uncategorised/35/expected.json index 8eea5108a9..78728a0062 100644 --- a/test/fixtures/es2015/uncategorised/35/expected.json +++ b/test/fixtures/es2015/uncategorised/35/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/es2015/uncategorised/350/expected.json b/test/fixtures/es2015/uncategorised/350/expected.json index 9e26dfeeb6..e0f955220c 100644 --- a/test/fixtures/es2015/uncategorised/350/expected.json +++ b/test/fixtures/es2015/uncategorised/350/expected.json @@ -1 +1,183 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "StringLiteral", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": "__proto__", + "raw": "'__proto__'" + }, + "value": "__proto__" + }, + "value": { + "type": "NumericLiteral", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ObjectProperty", + "start": 21, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "value": { + "type": "NumericLiteral", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/351/expected.json b/test/fixtures/es2015/uncategorised/351/expected.json index 9e26dfeeb6..2c0aacecab 100644 --- a/test/fixtures/es2015/uncategorised/351/expected.json +++ b/test/fixtures/es2015/uncategorised/351/expected.json @@ -1 +1,219 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [] + } + }, + { + "type": "ObjectProperty", + "start": 29, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 29, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "value": { + "type": "NumericLiteral", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/352/expected.json b/test/fixtures/es2015/uncategorised/352/expected.json index 9e26dfeeb6..8fc9a7d3a2 100644 --- a/test/fixtures/es2015/uncategorised/352/expected.json +++ b/test/fixtures/es2015/uncategorised/352/expected.json @@ -1 +1,219 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "kind": "get", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "directives": [] + } + }, + { + "type": "ObjectProperty", + "start": 33, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 33, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "value": { + "type": "NumericLiteral", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/354/expected.json b/test/fixtures/es2015/uncategorised/354/expected.json index 9e26dfeeb6..74e2c8a1e4 100644 --- a/test/fixtures/es2015/uncategorised/354/expected.json +++ b/test/fixtures/es2015/uncategorised/354/expected.json @@ -1 +1,69 @@ -{} \ No newline at end of file +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declaration": { + "type": "RegExpLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "raw": "/foo/" + }, + "pattern": "foo", + "flags": "" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/355/expected.json b/test/fixtures/es2015/uncategorised/355/expected.json index f77b5a851a..f916983e29 100644 --- a/test/fixtures/es2015/uncategorised/355/expected.json +++ b/test/fixtures/es2015/uncategorised/355/expected.json @@ -1,503 +1,190 @@ { - "type": "File", + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", "start": 0, "end": 29, "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } }, - "program": { - "type": "Program", + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", "start": 0, "end": 29, "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { "start": { - "line": 1, - "column": 0 + "line": 1, + "column": 9 }, "end": { - "line": 1, - "column": 29 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, - "name": "x" - }, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "ObjectPattern", - "start": 11, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "properties": [ - { - "type": "ObjectProperty", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "set" - }, - "name": "set" - }, - "value": { - "type": "AssignmentPattern", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "left": { - "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "set" - }, - "name": "set" - }, - "right": { - "type": "NullLiteral", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - } - } - }, - "extra": { - "shorthand": true - } - } - ] - } - ], - "body": { - "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "body": [], - "directives": [] - } - } - ], - "directives": [] - }, - "comments": [], - "tokens": [ - { - "type": { - "label": "function", - "keyword": "function", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "function", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "x", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null + "line": 1, + "column": 10 }, - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } + "identifierName": "x" + }, + "name": "x" }, - { - "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", "start": 11, - "end": 12, + "end": 25, "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 25 + } }, - "value": "set", - "start": 13, - "end": 16, - "loc": { - "start": { + "properties": [ + { + "type": "ObjectProperty", + "start": 13, + "end": 23, + "loc": { + "start": { "line": 1, "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": { - "label": "=", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": true, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "=", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } - }, - { - "type": { - "label": "null", - "keyword": "null", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "null", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { + }, + "end": { "line": 1, "column": 23 - } - } - }, - { - "type": { - "label": "}", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 + } }, - "end": { - "line": 1, - "column": 26 - } - } - }, - { - "type": { - "label": "{", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "set" + }, + "name": "set" }, - "end": { - "line": 1, - "column": 28 - } - } - }, - { - "type": { - "label": "}", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 + "value": { + "type": "AssignmentPattern", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "left": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "set" + }, + "name": "set" + }, + "right": { + "type": "NullLiteral", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + } + } }, - "end": { - "line": 1, - "column": 29 + "extra": { + "shorthand": true } - } - }, - { - "type": { - "label": "eof", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 }, - "start": 29, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 29 - } + "end": { + "line": 1, + "column": 29 } + }, + "body": [], + "directives": [] } - ] -} + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/36/expected.json b/test/fixtures/es2015/uncategorised/36/expected.json index af79a9f970..cdb2f5c52e 100644 --- a/test/fixtures/es2015/uncategorised/36/expected.json +++ b/test/fixtures/es2015/uncategorised/36/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "ArrayPattern", @@ -87,7 +88,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/es2015/uncategorised/39/expected.json b/test/fixtures/es2015/uncategorised/39/expected.json index d3ed02a634..e47019cdb6 100644 --- a/test/fixtures/es2015/uncategorised/39/expected.json +++ b/test/fixtures/es2015/uncategorised/39/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -138,7 +140,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -155,7 +158,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "x" }, "name": "x" } diff --git a/test/fixtures/es2015/uncategorised/40/expected.json b/test/fixtures/es2015/uncategorised/40/expected.json index 6e5b95dce8..b7e7b61001 100644 --- a/test/fixtures/es2015/uncategorised/40/expected.json +++ b/test/fixtures/es2015/uncategorised/40/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "eval" }, "name": "eval" } diff --git a/test/fixtures/es2015/uncategorised/41/expected.json b/test/fixtures/es2015/uncategorised/41/expected.json index 556e95a3ac..1f49c57e2d 100644 --- a/test/fixtures/es2015/uncategorised/41/expected.json +++ b/test/fixtures/es2015/uncategorised/41/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "arguments" }, "name": "arguments" } diff --git a/test/fixtures/es2015/uncategorised/42/expected.json b/test/fixtures/es2015/uncategorised/42/expected.json index 6ba8419a8b..a2bf196ca0 100644 --- a/test/fixtures/es2015/uncategorised/42/expected.json +++ b/test/fixtures/es2015/uncategorised/42/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/es2015/uncategorised/43/expected.json b/test/fixtures/es2015/uncategorised/43/expected.json index 6e06ca49e2..d912fa2794 100644 --- a/test/fixtures/es2015/uncategorised/43/expected.json +++ b/test/fixtures/es2015/uncategorised/43/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "eval" }, "name": "eval" }, @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/es2015/uncategorised/44/expected.json b/test/fixtures/es2015/uncategorised/44/expected.json index f280cb57bf..84f8889f2f 100644 --- a/test/fixtures/es2015/uncategorised/44/expected.json +++ b/test/fixtures/es2015/uncategorised/44/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "eval" }, "name": "eval" }, diff --git a/test/fixtures/es2015/uncategorised/45/expected.json b/test/fixtures/es2015/uncategorised/45/expected.json index 43ee9f5e11..31928b1851 100644 --- a/test/fixtures/es2015/uncategorised/45/expected.json +++ b/test/fixtures/es2015/uncategorised/45/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "eval" }, "name": "eval" }, @@ -102,7 +104,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/es2015/uncategorised/46/expected.json b/test/fixtures/es2015/uncategorised/46/expected.json index b565e367ee..cab6510eaf 100644 --- a/test/fixtures/es2015/uncategorised/46/expected.json +++ b/test/fixtures/es2015/uncategorised/46/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" } @@ -89,12 +91,14 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2015/uncategorised/47/expected.json b/test/fixtures/es2015/uncategorised/47/expected.json index 03125c85dd..5b9f51fa62 100644 --- a/test/fixtures/es2015/uncategorised/47/expected.json +++ b/test/fixtures/es2015/uncategorised/47/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" } @@ -94,6 +96,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -107,7 +110,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/es2015/uncategorised/48/expected.json b/test/fixtures/es2015/uncategorised/48/expected.json index 7d5558cdaf..864245ed88 100644 --- a/test/fixtures/es2015/uncategorised/48/expected.json +++ b/test/fixtures/es2015/uncategorised/48/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" } @@ -94,6 +96,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -107,7 +110,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -123,7 +127,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "z" }, "name": "z" } @@ -155,7 +160,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -171,7 +177,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -187,17 +194,20 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "z" }, "name": "z" } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 18 } }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 7 } } } diff --git a/test/fixtures/es2015/uncategorised/49/expected.json b/test/fixtures/es2015/uncategorised/49/expected.json index 5722472386..d6a7efe40f 100644 --- a/test/fixtures/es2015/uncategorised/49/expected.json +++ b/test/fixtures/es2015/uncategorised/49/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -105,13 +107,14 @@ "column": 12 } }, - "body": [] + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/5/expected.json b/test/fixtures/es2015/uncategorised/5/expected.json index f95c3acfdb..8a3dd5608b 100644 --- a/test/fixtures/es2015/uncategorised/5/expected.json +++ b/test/fixtures/es2015/uncategorised/5/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "test" }, "name": "test" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/50/expected.json b/test/fixtures/es2015/uncategorised/50/expected.json index a27dc04bfa..e5022056df 100644 --- a/test/fixtures/es2015/uncategorised/50/expected.json +++ b/test/fixtures/es2015/uncategorised/50/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -103,7 +105,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -119,7 +122,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "y" }, "name": "y" } @@ -138,13 +142,14 @@ "column": 16 } }, - "body": [] + "body": [], + "directives": [] } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/52/expected.json b/test/fixtures/es2015/uncategorised/52/expected.json index 880dce74c2..ce0016fdc3 100644 --- a/test/fixtures/es2015/uncategorised/52/expected.json +++ b/test/fixtures/es2015/uncategorised/52/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "method" }, "name": "method" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/53/expected.json b/test/fixtures/es2015/uncategorised/53/expected.json index 7d5dce4954..403f65e101 100644 --- a/test/fixtures/es2015/uncategorised/53/expected.json +++ b/test/fixtures/es2015/uncategorised/53/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "method" }, "name": "method" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -138,7 +141,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "test" }, "name": "test" } diff --git a/test/fixtures/es2015/uncategorised/54/expected.json b/test/fixtures/es2015/uncategorised/54/expected.json index 1030bf0af2..cc11812169 100644 --- a/test/fixtures/es2015/uncategorised/54/expected.json +++ b/test/fixtures/es2015/uncategorised/54/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -129,6 +130,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/55/expected.json b/test/fixtures/es2015/uncategorised/55/expected.json index 0b0d3f1c10..a8769bfc25 100644 --- a/test/fixtures/es2015/uncategorised/55/expected.json +++ b/test/fixtures/es2015/uncategorised/55/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "get" }, "name": "get" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/56/expected.json b/test/fixtures/es2015/uncategorised/56/expected.json index b118b76443..98450690a7 100644 --- a/test/fixtures/es2015/uncategorised/56/expected.json +++ b/test/fixtures/es2015/uncategorised/56/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "set" }, "name": "set" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/61/expected.json b/test/fixtures/es2015/uncategorised/61/expected.json index 660265dd75..17d1d997d4 100644 --- a/test/fixtures/es2015/uncategorised/61/expected.json +++ b/test/fixtures/es2015/uncategorised/61/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -133,9 +135,13 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "y" }, "name": "y" + }, + "extra": { + "shorthand": true } }, { @@ -167,7 +173,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "z" }, "name": "z" }, @@ -183,9 +190,13 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "z" }, "name": "z" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/62/expected.json b/test/fixtures/es2015/uncategorised/62/expected.json index 6e74cfdbcb..65027d5460 100644 --- a/test/fixtures/es2015/uncategorised/62/expected.json +++ b/test/fixtures/es2015/uncategorised/62/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -100,7 +101,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "b" }, "name": "b" } @@ -133,7 +135,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -149,7 +152,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a" } @@ -157,7 +161,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/63/expected.json b/test/fixtures/es2015/uncategorised/63/expected.json index f17d4e7f50..b52b7efed4 100644 --- a/test/fixtures/es2015/uncategorised/63/expected.json +++ b/test/fixtures/es2015/uncategorised/63/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/64/expected.json b/test/fixtures/es2015/uncategorised/64/expected.json index d970cbce76..56160d2041 100644 --- a/test/fixtures/es2015/uncategorised/64/expected.json +++ b/test/fixtures/es2015/uncategorised/64/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" } @@ -110,7 +111,7 @@ ], "kind": "const" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/65/expected.json b/test/fixtures/es2015/uncategorised/65/expected.json index d449479dc0..8f76a24663 100644 --- a/test/fixtures/es2015/uncategorised/65/expected.json +++ b/test/fixtures/es2015/uncategorised/65/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/66/expected.json b/test/fixtures/es2015/uncategorised/66/expected.json index 58be00e51c..104284ae40 100644 --- a/test/fixtures/es2015/uncategorised/66/expected.json +++ b/test/fixtures/es2015/uncategorised/66/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" } @@ -110,7 +111,7 @@ ], "kind": "let" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/67/expected.json b/test/fixtures/es2015/uncategorised/67/expected.json index 5847b666e3..f166d30898 100644 --- a/test/fixtures/es2015/uncategorised/67/expected.json +++ b/test/fixtures/es2015/uncategorised/67/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/es2015/uncategorised/68/expected.json b/test/fixtures/es2015/uncategorised/68/expected.json index aabef1030c..19bdfa758b 100644 --- a/test/fixtures/es2015/uncategorised/68/expected.json +++ b/test/fixtures/es2015/uncategorised/68/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" } @@ -110,7 +111,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/69/expected.json b/test/fixtures/es2015/uncategorised/69/expected.json index f2577d66d0..d4b8dda2a4 100644 --- a/test/fixtures/es2015/uncategorised/69/expected.json +++ b/test/fixtures/es2015/uncategorised/69/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/es2015/uncategorised/70/expected.json b/test/fixtures/es2015/uncategorised/70/expected.json index a9efc0fea7..6ae7f4bf7f 100644 --- a/test/fixtures/es2015/uncategorised/70/expected.json +++ b/test/fixtures/es2015/uncategorised/70/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/es2015/uncategorised/71/expected.json b/test/fixtures/es2015/uncategorised/71/expected.json index 0615d247ab..2175291efc 100644 --- a/test/fixtures/es2015/uncategorised/71/expected.json +++ b/test/fixtures/es2015/uncategorised/71/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/es2015/uncategorised/72/expected.json b/test/fixtures/es2015/uncategorised/72/expected.json index 1bd46b7ac0..2a45478e63 100644 --- a/test/fixtures/es2015/uncategorised/72/expected.json +++ b/test/fixtures/es2015/uncategorised/72/expected.json @@ -42,6 +42,8 @@ "column": 19 } }, + "specifiers": [], + "source": null, "declaration": { "type": "VariableDeclaration", "start": 7, @@ -83,7 +85,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "document" }, "name": "document" }, @@ -91,11 +94,9 @@ } ], "kind": "var" - }, - "specifiers": [], - "source": null + } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/73/expected.json b/test/fixtures/es2015/uncategorised/73/expected.json index 3bfdd45a05..df0ab00a10 100644 --- a/test/fixtures/es2015/uncategorised/73/expected.json +++ b/test/fixtures/es2015/uncategorised/73/expected.json @@ -42,6 +42,8 @@ "column": 25 } }, + "specifiers": [], + "source": null, "declaration": { "type": "VariableDeclaration", "start": 7, @@ -83,7 +85,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "document" }, "name": "document" }, @@ -106,11 +109,9 @@ } ], "kind": "var" - }, - "specifiers": [], - "source": null + } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/74/expected.json b/test/fixtures/es2015/uncategorised/74/expected.json index 83501be44d..02defa9c2f 100644 --- a/test/fixtures/es2015/uncategorised/74/expected.json +++ b/test/fixtures/es2015/uncategorised/74/expected.json @@ -42,6 +42,8 @@ "column": 19 } }, + "specifiers": [], + "source": null, "declaration": { "type": "VariableDeclaration", "start": 7, @@ -83,7 +85,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "document" }, "name": "document" }, @@ -91,11 +94,9 @@ } ], "kind": "let" - }, - "specifiers": [], - "source": null + } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/75/expected.json b/test/fixtures/es2015/uncategorised/75/expected.json index fe06e4b03e..080ac3a873 100644 --- a/test/fixtures/es2015/uncategorised/75/expected.json +++ b/test/fixtures/es2015/uncategorised/75/expected.json @@ -42,6 +42,8 @@ "column": 25 } }, + "specifiers": [], + "source": null, "declaration": { "type": "VariableDeclaration", "start": 7, @@ -83,7 +85,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "document" }, "name": "document" }, @@ -106,11 +109,9 @@ } ], "kind": "let" - }, - "specifiers": [], - "source": null + } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/76/expected.json b/test/fixtures/es2015/uncategorised/76/expected.json index ff09e9c318..7047c35c8e 100644 --- a/test/fixtures/es2015/uncategorised/76/expected.json +++ b/test/fixtures/es2015/uncategorised/76/expected.json @@ -42,6 +42,8 @@ "column": 27 } }, + "specifiers": [], + "source": null, "declaration": { "type": "VariableDeclaration", "start": 7, @@ -83,7 +85,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "document" }, "name": "document" }, @@ -106,11 +109,9 @@ } ], "kind": "const" - }, - "specifiers": [], - "source": null + } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/77/expected.json b/test/fixtures/es2015/uncategorised/77/expected.json index 9eada77464..43573a5711 100644 --- a/test/fixtures/es2015/uncategorised/77/expected.json +++ b/test/fixtures/es2015/uncategorised/77/expected.json @@ -42,6 +42,8 @@ "column": 27 } }, + "specifiers": [], + "source": null, "declaration": { "type": "FunctionDeclaration", "start": 7, @@ -68,12 +70,14 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "parse" }, "name": "parse" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -89,13 +93,12 @@ "column": 27 } }, - "body": [] + "body": [], + "directives": [] } - }, - "specifiers": [], - "source": null + } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/78/expected.json b/test/fixtures/es2015/uncategorised/78/expected.json index 013eb146ba..8dd1cb816a 100644 --- a/test/fixtures/es2015/uncategorised/78/expected.json +++ b/test/fixtures/es2015/uncategorised/78/expected.json @@ -42,6 +42,8 @@ "column": 21 } }, + "specifiers": [], + "source": null, "declaration": { "type": "ClassDeclaration", "start": 7, @@ -68,7 +70,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "Class" }, "name": "Class" }, @@ -89,11 +92,9 @@ }, "body": [] } - }, - "specifiers": [], - "source": null + } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/80/expected.json b/test/fixtures/es2015/uncategorised/80/expected.json index 364e85431c..3c9a9fc01d 100644 --- a/test/fixtures/es2015/uncategorised/80/expected.json +++ b/test/fixtures/es2015/uncategorised/80/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/81/expected.json b/test/fixtures/es2015/uncategorised/81/expected.json index 2bcb3a0d57..2296dba4c1 100644 --- a/test/fixtures/es2015/uncategorised/81/expected.json +++ b/test/fixtures/es2015/uncategorised/81/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -89,11 +91,12 @@ "column": 30 } }, - "body": [] + "body": [], + "directives": [] } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/83/expected.json b/test/fixtures/es2015/uncategorised/83/expected.json index fe765d760c..6e81e442fa 100644 --- a/test/fixtures/es2015/uncategorised/83/expected.json +++ b/test/fixtures/es2015/uncategorised/83/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -91,7 +92,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/86/expected.json b/test/fixtures/es2015/uncategorised/86/expected.json index ae2d126022..ec59c9ee3d 100644 --- a/test/fixtures/es2015/uncategorised/86/expected.json +++ b/test/fixtures/es2015/uncategorised/86/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" } @@ -94,7 +96,7 @@ ], "source": null } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/87/expected.json b/test/fixtures/es2015/uncategorised/87/expected.json index 7b44c44875..e702916375 100644 --- a/test/fixtures/es2015/uncategorised/87/expected.json +++ b/test/fixtures/es2015/uncategorised/87/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" } @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "decrypt" }, "name": "decrypt" }, @@ -133,7 +136,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "decrypt" }, "name": "decrypt" } @@ -141,7 +145,7 @@ ], "source": null } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/88/expected.json b/test/fixtures/es2015/uncategorised/88/expected.json index afbd89b3af..69f3a20244 100644 --- a/test/fixtures/es2015/uncategorised/88/expected.json +++ b/test/fixtures/es2015/uncategorised/88/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "default" }, "name": "default" } @@ -94,7 +96,7 @@ ], "source": null } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/89/expected.json b/test/fixtures/es2015/uncategorised/89/expected.json index a0329fee1e..a7fbc886d2 100644 --- a/test/fixtures/es2015/uncategorised/89/expected.json +++ b/test/fixtures/es2015/uncategorised/89/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" } @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "decrypt" }, "name": "decrypt" }, @@ -133,7 +136,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "dec" }, "name": "dec" } @@ -141,7 +145,7 @@ ], "source": null } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/9/expected.json b/test/fixtures/es2015/uncategorised/9/expected.json index 8fe8a8579a..95b01a403f 100644 --- a/test/fixtures/es2015/uncategorised/9/expected.json +++ b/test/fixtures/es2015/uncategorised/9/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "test" }, "name": "test" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2015/uncategorised/90/expected.json b/test/fixtures/es2015/uncategorised/90/expected.json index 2ca5064302..a00392fd81 100644 --- a/test/fixtures/es2015/uncategorised/90/expected.json +++ b/test/fixtures/es2015/uncategorised/90/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "default" }, "name": "default" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "default" }, "name": "default" } diff --git a/test/fixtures/es2015/uncategorised/92/expected.json b/test/fixtures/es2015/uncategorised/92/expected.json index d1465085b3..cf96958292 100644 --- a/test/fixtures/es2015/uncategorised/92/expected.json +++ b/test/fixtures/es2015/uncategorised/92/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "$" }, "name": "$" } diff --git a/test/fixtures/es2015/uncategorised/93/expected.json b/test/fixtures/es2015/uncategorised/93/expected.json index a6757e53fe..b411707a75 100644 --- a/test/fixtures/es2015/uncategorised/93/expected.json +++ b/test/fixtures/es2015/uncategorised/93/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" } @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "decrypt" }, "name": "decrypt" }, @@ -132,7 +135,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "decrypt" }, "name": "decrypt" } diff --git a/test/fixtures/es2015/uncategorised/94/expected.json b/test/fixtures/es2015/uncategorised/94/expected.json index 2ab3fc92e8..9de2ba1112 100644 --- a/test/fixtures/es2015/uncategorised/94/expected.json +++ b/test/fixtures/es2015/uncategorised/94/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "enc" }, "name": "enc" } diff --git a/test/fixtures/es2015/uncategorised/95/expected.json b/test/fixtures/es2015/uncategorised/95/expected.json index 9b9cd83bc5..0ae46ee594 100644 --- a/test/fixtures/es2015/uncategorised/95/expected.json +++ b/test/fixtures/es2015/uncategorised/95/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "crypto" }, "name": "crypto" } @@ -100,7 +101,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "decrypt" }, "name": "decrypt" }, @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "decrypt" }, "name": "decrypt" } @@ -147,7 +150,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "encrypt" }, "name": "encrypt" }, @@ -163,7 +167,8 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "enc" }, "name": "enc" } diff --git a/test/fixtures/es2015/uncategorised/97/expected.json b/test/fixtures/es2015/uncategorised/97/expected.json index 378e45b83b..518aaeb40a 100644 --- a/test/fixtures/es2015/uncategorised/97/expected.json +++ b/test/fixtures/es2015/uncategorised/97/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "null" }, "name": "null" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "nil" }, "name": "nil" } diff --git a/test/fixtures/es2015/uncategorised/98/expected.json b/test/fixtures/es2015/uncategorised/98/expected.json index d29972d512..24bc22c1fb 100644 --- a/test/fixtures/es2015/uncategorised/98/expected.json +++ b/test/fixtures/es2015/uncategorised/98/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "crypto" }, "name": "crypto" } diff --git a/test/fixtures/es2015/uncategorised/99/expected.json b/test/fixtures/es2015/uncategorised/99/expected.json index 0e1df863cc..6370008347 100644 --- a/test/fixtures/es2015/uncategorised/99/expected.json +++ b/test/fixtures/es2015/uncategorised/99/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,7 +117,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "v" }, "name": "v" } @@ -126,7 +128,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2016/exponentiation-operator/2/expected.json b/test/fixtures/es2016/exponentiation-operator/2/expected.json index 7908853db6..a1034e6eab 100644 --- a/test/fixtures/es2016/exponentiation-operator/2/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/2/expected.json @@ -117,10 +117,13 @@ "parenthesized": true, "parenStart": 1 } + }, + "extra": { + "parenthesizedArgument": false } } } ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/es2016/exponentiation-operator/3/expected.json b/test/fixtures/es2016/exponentiation-operator/3/expected.json index b5656e2456..9f2b2bf906 100644 --- a/test/fixtures/es2016/exponentiation-operator/3/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/3/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/es2016/exponentiation-operator/4/expected.json b/test/fixtures/es2016/exponentiation-operator/4/expected.json index 0df9404a78..80baa26315 100644 --- a/test/fixtures/es2016/exponentiation-operator/4/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/4/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "squared" }, "name": "squared" }, diff --git a/test/fixtures/es2016/exponentiation-operator/5/expected.json b/test/fixtures/es2016/exponentiation-operator/5/expected.json index e8ad51d1b7..22286c57b0 100644 --- a/test/fixtures/es2016/exponentiation-operator/5/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/5/expected.json @@ -133,7 +133,8 @@ "value": 2 }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 5 } } } diff --git a/test/fixtures/es2016/exponentiation-operator/7/expected.json b/test/fixtures/es2016/exponentiation-operator/7/expected.json index f61979779e..c8dbba2bbd 100644 --- a/test/fixtures/es2016/exponentiation-operator/7/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/7/expected.json @@ -126,10 +126,14 @@ "raw": "1" }, "value": 1 + }, + "extra": { + "parenthesizedArgument": false } }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } }, "operator": "*", diff --git a/test/fixtures/es2016/exponentiation-operator/8/expected.json b/test/fixtures/es2016/exponentiation-operator/8/expected.json index 154543b04b..11a204dbe5 100644 --- a/test/fixtures/es2016/exponentiation-operator/8/expected.json +++ b/test/fixtures/es2016/exponentiation-operator/8/expected.json @@ -126,6 +126,9 @@ "raw": "1" }, "value": 1 + }, + "extra": { + "parenthesizedArgument": false } } }, diff --git a/test/fixtures/es2017/async-functions/11/expected.json b/test/fixtures/es2017/async-functions/11/expected.json index 519910a604..3d14dde860 100644 --- a/test/fixtures/es2017/async-functions/11/expected.json +++ b/test/fixtures/es2017/async-functions/11/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "async" }, "name": "async" } @@ -85,12 +86,14 @@ "end": { "line": 2, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/es2017/async-functions/12/expected.json b/test/fixtures/es2017/async-functions/12/expected.json index 1624ec0050..8398464169 100644 --- a/test/fixtures/es2017/async-functions/12/expected.json +++ b/test/fixtures/es2017/async-functions/12/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -74,7 +75,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "promise" }, "name": "promise" } @@ -134,15 +136,18 @@ "end": { "line": 1, "column": 43 - } + }, + "identifierName": "promise" }, "name": "promise" } } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/13/expected.json b/test/fixtures/es2017/async-functions/13/expected.json index 7656d8bdf0..02dbad929b 100644 --- a/test/fixtures/es2017/async-functions/13/expected.json +++ b/test/fixtures/es2017/async-functions/13/expected.json @@ -73,7 +73,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "x" }, "name": "x" } @@ -119,7 +120,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "inner" }, "name": "inner" }, @@ -182,7 +184,8 @@ "end": { "line": 1, "column": 47 - } + }, + "identifierName": "x" }, "name": "x" } @@ -196,11 +199,12 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/14/expected.json b/test/fixtures/es2017/async-functions/14/expected.json index 236d7969c2..f02a870e41 100644 --- a/test/fixtures/es2017/async-functions/14/expected.json +++ b/test/fixtures/es2017/async-functions/14/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "promise" }, "name": "promise" } @@ -164,19 +166,22 @@ "end": { "line": 1, "column": 49 - } + }, + "identifierName": "promise" }, "name": "promise" } } } - ] + ], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/15/expected.json b/test/fixtures/es2017/async-functions/15/expected.json index 3e9c3b4608..fe07c7f6de 100644 --- a/test/fixtures/es2017/async-functions/15/expected.json +++ b/test/fixtures/es2017/async-functions/15/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "o" }, "name": "o" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -171,7 +173,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -193,7 +196,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "promise" }, "name": "promise" } @@ -253,7 +257,8 @@ "end": { "line": 1, "column": 50 - } + }, + "identifierName": "promise" }, "name": "promise" } @@ -272,4 +277,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/16/expected.json b/test/fixtures/es2017/async-functions/16/expected.json index b845c0fb22..186ab6f31f 100644 --- a/test/fixtures/es2017/async-functions/16/expected.json +++ b/test/fixtures/es2017/async-functions/16/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 48 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": false, "kind": "method", "id": null, "generator": false, @@ -124,7 +126,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "promise" }, "name": "promise" } @@ -184,7 +187,8 @@ "end": { "line": 1, "column": 46 - } + }, + "identifierName": "promise" }, "name": "promise" } @@ -200,4 +204,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/17/expected.json b/test/fixtures/es2017/async-functions/17/expected.json index e84017c870..a5afb02270 100644 --- a/test/fixtures/es2017/async-functions/17/expected.json +++ b/test/fixtures/es2017/async-functions/17/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -120,7 +122,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "promise" }, "name": "promise" } @@ -151,7 +154,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "promise" }, "name": "promise" } @@ -160,6 +164,7 @@ ] } } - ] + ], + "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/18/expected.json b/test/fixtures/es2017/async-functions/18/expected.json index 44b482a1e8..2b5f4bdab0 100644 --- a/test/fixtures/es2017/async-functions/18/expected.json +++ b/test/fixtures/es2017/async-functions/18/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "promise" }, "name": "promise" } @@ -164,18 +166,21 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "promise" }, "name": "promise" } } } - ] + ], + "directives": [] } } ] } } - ] + ], + "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/19/expected.json b/test/fixtures/es2017/async-functions/19/expected.json index f427340e7c..d10cdb5808 100644 --- a/test/fixtures/es2017/async-functions/19/expected.json +++ b/test/fixtures/es2017/async-functions/19/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -115,7 +117,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "async" }, "name": "async" }, @@ -174,7 +177,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/es2017/async-functions/20/expected.json b/test/fixtures/es2017/async-functions/20/expected.json index 235acc93f8..da3b22f11f 100644 --- a/test/fixtures/es2017/async-functions/20/expected.json +++ b/test/fixtures/es2017/async-functions/20/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "ok" }, "name": "ok" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "async" }, "name": "async" }, @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "x" }, "name": "x" } @@ -126,7 +129,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/21/expected.json b/test/fixtures/es2017/async-functions/21/expected.json index 8c6bec9861..e881d2604b 100644 --- a/test/fixtures/es2017/async-functions/21/expected.json +++ b/test/fixtures/es2017/async-functions/21/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,7 +117,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "async" }, "name": "async" }, @@ -166,7 +168,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "async" }, "name": "async" }, @@ -196,7 +199,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/es2017/async-functions/22/expected.json b/test/fixtures/es2017/async-functions/22/expected.json index 0c05743d58..6975fdfe3b 100644 --- a/test/fixtures/es2017/async-functions/22/expected.json +++ b/test/fixtures/es2017/async-functions/22/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "Test" }, "name": "Test" }, @@ -88,6 +89,7 @@ "column": 23 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "async" }, "name": "async" }, - "static": false, "kind": "method", "id": null, "generator": false, diff --git a/test/fixtures/es2017/async-functions/23/expected.json b/test/fixtures/es2017/async-functions/23/expected.json index a5e072a934..3890646e01 100644 --- a/test/fixtures/es2017/async-functions/23/expected.json +++ b/test/fixtures/es2017/async-functions/23/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "obj" }, "name": "obj" }, @@ -116,10 +117,12 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "async" }, "name": "async" }, + "computed": false, "value": { "type": "StringLiteral", "start": 19, diff --git a/test/fixtures/es2017/async-functions/24/expected.json b/test/fixtures/es2017/async-functions/24/expected.json index 1078686a77..bdd29cecde 100644 --- a/test/fixtures/es2017/async-functions/24/expected.json +++ b/test/fixtures/es2017/async-functions/24/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "obj" }, "name": "obj" }, @@ -116,10 +117,12 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "async" }, "name": "async" }, + "computed": false, "kind": "method", "id": null, "generator": false, diff --git a/test/fixtures/es2017/async-functions/25/expected.json b/test/fixtures/es2017/async-functions/25/expected.json index 9b136c3ea4..a3bcbae858 100644 --- a/test/fixtures/es2017/async-functions/25/expected.json +++ b/test/fixtures/es2017/async-functions/25/expected.json @@ -42,6 +42,8 @@ "column": 30 } }, + "specifiers": [], + "source": null, "declaration": { "type": "FunctionDeclaration", "start": 7, @@ -68,7 +70,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -90,12 +93,12 @@ "column": 30 } }, - "body": [] + "body": [], + "directives": [] } - }, - "specifiers": [], - "source": null + } } - ] + ], + "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/es2017/async-functions/27/expected.json b/test/fixtures/es2017/async-functions/27/expected.json index ccacb5ffa3..1e70bd9615 100644 --- a/test/fixtures/es2017/async-functions/27/expected.json +++ b/test/fixtures/es2017/async-functions/27/expected.json @@ -141,6 +141,7 @@ }, "name": "async" }, + "computed": false, "value": { "type": "AssignmentPattern", "start": 15, diff --git a/test/fixtures/es2017/async-functions/28/expected.json b/test/fixtures/es2017/async-functions/28/expected.json index bde4093e1f..d90f600a88 100644 --- a/test/fixtures/es2017/async-functions/28/expected.json +++ b/test/fixtures/es2017/async-functions/28/expected.json @@ -141,6 +141,7 @@ }, "name": "async" }, + "computed": false, "value": { "type": "Identifier", "start": 22, diff --git a/test/fixtures/es2017/async-functions/31/expected.json b/test/fixtures/es2017/async-functions/31/expected.json index 92d6c16d7a..b4f0aea8b8 100644 --- a/test/fixtures/es2017/async-functions/31/expected.json +++ b/test/fixtures/es2017/async-functions/31/expected.json @@ -141,6 +141,7 @@ }, "name": "async" }, + "computed": false, "value": { "type": "Identifier", "start": 28, diff --git a/test/fixtures/es2017/async-functions/32/expected.json b/test/fixtures/es2017/async-functions/32/expected.json index 8c778ed135..7cdfabffe3 100644 --- a/test/fixtures/es2017/async-functions/32/expected.json +++ b/test/fixtures/es2017/async-functions/32/expected.json @@ -141,6 +141,7 @@ }, "name": "async" }, + "computed": false, "value": { "type": "AssignmentPattern", "start": 21, diff --git a/test/fixtures/es2017/async-functions/7/expected.json b/test/fixtures/es2017/async-functions/7/expected.json index bd3c1e7695..a896663d5d 100644 --- a/test/fixtures/es2017/async-functions/7/expected.json +++ b/test/fixtures/es2017/async-functions/7/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -116,10 +117,12 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "async" }, "name": "async" }, + "computed": false, "value": { "type": "Identifier", "start": 6, @@ -132,9 +135,13 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "async" }, "name": "async" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/es2017/async-functions/8/expected.json b/test/fixtures/es2017/async-functions/8/expected.json index 339a3925ef..b1aba60ea4 100644 --- a/test/fixtures/es2017/async-functions/8/expected.json +++ b/test/fixtures/es2017/async-functions/8/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "async" }, "name": "async" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "async" }, "name": "async" + }, + "extra": { + "shorthand": true } } ] @@ -150,7 +155,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "require" }, "name": "require" }, diff --git a/test/fixtures/es2017/trailing-function-commas/1/expected.json b/test/fixtures/es2017/trailing-function-commas/1/expected.json index e4e327f6b7..af9edda08a 100644 --- a/test/fixtures/es2017/trailing-function-commas/1/expected.json +++ b/test/fixtures/es2017/trailing-function-commas/1/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "log" }, "name": "log" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "n" }, "name": "n" }, diff --git a/test/fixtures/es2017/trailing-function-commas/2/expected.json b/test/fixtures/es2017/trailing-function-commas/2/expected.json index 31ecdf84a7..99e64d2352 100644 --- a/test/fixtures/es2017/trailing-function-commas/2/expected.json +++ b/test/fixtures/es2017/trailing-function-commas/2/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "log" }, "name": "log" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "n" }, "name": "n" }, @@ -89,7 +92,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "op" }, "name": "op" }, @@ -105,7 +109,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "val" }, "name": "val" } @@ -124,9 +129,11 @@ "column": 29 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/es2017/trailing-function-commas/3/expected.json b/test/fixtures/es2017/trailing-function-commas/3/expected.json index 84ddd9f145..333b273272 100644 --- a/test/fixtures/es2017/trailing-function-commas/3/expected.json +++ b/test/fixtures/es2017/trailing-function-commas/3/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 23 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -123,7 +126,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/es2017/trailing-function-commas/4/expected.json b/test/fixtures/es2017/trailing-function-commas/4/expected.json index 74c2247c3f..53f94b690d 100644 --- a/test/fixtures/es2017/trailing-function-commas/4/expected.json +++ b/test/fixtures/es2017/trailing-function-commas/4/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/expected.json index bab8079535..855b9666cc 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" } @@ -116,14 +117,20 @@ "end": { "line": 2, "column": 3 - } + }, + "identifierName": "y" }, "name": "y" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/expected.json index e7aa5f92ff..f531eb96b4 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" } @@ -116,14 +117,20 @@ "end": { "line": 2, "column": 3 - } + }, + "identifierName": "y" }, "name": "y" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/expected.json index b80d317427..3840e25325 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x", "leadingComments": null, diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/expected.json index 0c955c4730..3881fa499d 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -135,7 +136,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -189,7 +191,8 @@ "end": { "line": 2, "column": 1 - } + }, + "identifierName": "z" }, "name": "z" } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/expected.json index 1c02f6ef66..84e28f3bd9 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/expected.json @@ -115,7 +115,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "there" }, "name": "there" } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/expected.json index 675fe056a3..fd7f41293b 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/expected.json @@ -134,7 +134,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "there" }, "name": "there", "leadingComments": null diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/expected.json index dfef6b5c50..820264c6d1 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/expected.json @@ -134,7 +134,8 @@ "end": { "line": 2, "column": 15 - } + }, + "identifierName": "there" }, "name": "there", "leadingComments": null diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/expected.json index 2b8d9fef9f..560762d177 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/expected.json @@ -115,7 +115,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "there" }, "name": "there" } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/expected.json index 21c911cbbc..b5794cac3a 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/expected.json @@ -134,7 +134,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "there" }, "name": "there", "leadingComments": null diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/expected.json index 55ac6a29a8..62b72404df 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/expected.json @@ -134,7 +134,8 @@ "end": { "line": 2, "column": 15 - } + }, + "identifierName": "there" }, "name": "there", "leadingComments": null diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/expected.json index 7d4c8d5bb6..e5fa9ec260 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,7 +118,8 @@ "end": { "line": 2, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" } @@ -126,7 +128,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/expected.json index f0cf8a4b53..3b50dd8b73 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -136,7 +137,8 @@ "end": { "line": 2, "column": 1 - } + }, + "identifierName": "x" }, "name": "x", "leadingComments": null @@ -164,7 +166,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/expected.json index 975bfdf605..6ae21e8aa6 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -136,7 +137,8 @@ "end": { "line": 2, "column": 11 - } + }, + "identifierName": "x" }, "name": "x", "leadingComments": null @@ -164,7 +166,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/expected.json index d55af430c7..d1fb3ac429 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "error" }, "name": "error" } @@ -100,13 +101,16 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "error" }, "name": "error" } } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/expected.json index 1340d70360..55562ff024 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "error" }, "name": "error", "leadingComments": null, @@ -120,7 +121,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "error" }, "name": "error", "leadingComments": null diff --git a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/expected.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/expected.json index fcf481f414..acb5183a09 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/expected.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "error" }, "name": "error", "leadingComments": null, @@ -120,7 +121,8 @@ "end": { "line": 2, "column": 15 - } + }, + "identifierName": "error" }, "name": "error", "leadingComments": null diff --git a/test/fixtures/esprima/declaration-const/migrated_0000/expected.json b/test/fixtures/esprima/declaration-const/migrated_0000/expected.json index e194cd4fc2..5b8946932d 100644 --- a/test/fixtures/esprima/declaration-const/migrated_0000/expected.json +++ b/test/fixtures/esprima/declaration-const/migrated_0000/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/declaration-const/migrated_0001/expected.json b/test/fixtures/esprima/declaration-const/migrated_0001/expected.json index a68a9f9594..72f1b62331 100644 --- a/test/fixtures/esprima/declaration-const/migrated_0001/expected.json +++ b/test/fixtures/esprima/declaration-const/migrated_0001/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/declaration-const/migrated_0002/expected.json b/test/fixtures/esprima/declaration-const/migrated_0002/expected.json index 3df4bb7dd4..3a4b88e0fc 100644 --- a/test/fixtures/esprima/declaration-const/migrated_0002/expected.json +++ b/test/fixtures/esprima/declaration-const/migrated_0002/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -135,7 +136,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -186,7 +188,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "z" }, "name": "z" }, diff --git a/test/fixtures/esprima/declaration-function/migrated_0000/expected.json b/test/fixtures/esprima/declaration-function/migrated_0000/expected.json index 8de460e887..89d8911652 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0000/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0000/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "hello" }, "name": "hello" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,16 +118,19 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0001/expected.json b/test/fixtures/esprima/declaration-function/migrated_0001/expected.json index d8bcde0844..01acb188ed 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0001/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0001/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "eval" }, "name": "eval" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -75,9 +77,11 @@ "column": 19 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0002/expected.json b/test/fixtures/esprima/declaration-function/migrated_0002/expected.json index 086e1ef65b..93d4d923bf 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0002/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0002/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -75,9 +77,11 @@ "column": 24 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0003/expected.json b/test/fixtures/esprima/declaration-function/migrated_0003/expected.json index c081c978ea..05cce3b8f3 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0003/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0003/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "test" }, "name": "test" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "t" }, "name": "t" }, @@ -89,7 +92,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "t" }, "name": "t" } @@ -108,9 +112,11 @@ "column": 23 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0004/expected.json b/test/fixtures/esprima/declaration-function/migrated_0004/expected.json index a9c517251e..4b79120694 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0004/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0004/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "test" }, "name": "test" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -87,7 +89,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "t" }, "name": "t" }, @@ -103,7 +106,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "t" }, "name": "t" } @@ -126,7 +130,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/declaration-function/migrated_0005/expected.json b/test/fixtures/esprima/declaration-function/migrated_0005/expected.json index 5924cefb02..1b08145eb9 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0005/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0005/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "eval" }, "name": "eval" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -102,12 +104,14 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "inner" }, "name": "inner" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/declaration-function/migrated_0006/expected.json b/test/fixtures/esprima/declaration-function/migrated_0006/expected.json index 3d1b214f48..a5373f5a79 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0006/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0006/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "hello" }, "name": "hello" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "a" }, "name": "a" } @@ -133,16 +136,19 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0007/expected.json b/test/fixtures/esprima/declaration-function/migrated_0007/expected.json index 8bc6714852..cdfeb7b019 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0007/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0007/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "hello" }, "name": "hello" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -89,7 +92,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "b" }, "name": "b" } @@ -149,16 +153,19 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0008/expected.json b/test/fixtures/esprima/declaration-function/migrated_0008/expected.json index 6483debdcd..7df304a88a 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0008/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0008/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "hi" }, "name": "hi" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -146,20 +148,23 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0009/expected.json b/test/fixtures/esprima/declaration-function/migrated_0009/expected.json index b4b770ef03..ce5cb42288 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0009/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0009/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "hi" }, "name": "hi" }, @@ -99,12 +100,14 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "eval" }, "name": "eval" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -120,13 +123,15 @@ "column": 28 } }, - "body": [] + "body": [], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0010/expected.json b/test/fixtures/esprima/declaration-function/migrated_0010/expected.json index 75abd7b81c..2b88f0d953 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0010/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0010/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "hi" }, "name": "hi" }, @@ -99,12 +100,14 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -120,13 +123,15 @@ "column": 33 } }, - "body": [] + "body": [], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0011/expected.json b/test/fixtures/esprima/declaration-function/migrated_0011/expected.json index 71c7365c51..f3e529622f 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0011/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0011/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "hello" }, "name": "hello" }, @@ -99,12 +100,14 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "hi" }, "name": "hi" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -161,20 +164,23 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "sayHi" }, "name": "sayHi" }, "arguments": [] } } - ] + ], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0012/expected.json b/test/fixtures/esprima/declaration-function/migrated_0012/expected.json index fac0f4b32c..f79af90cc1 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0012/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0012/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -78,7 +79,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/declaration-function/migrated_0013/expected.json b/test/fixtures/esprima/declaration-function/migrated_0013/expected.json index e9af076d07..511cc1461a 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0013/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0013/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "universe" }, "name": "universe" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" } @@ -92,9 +95,11 @@ "column": 32 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-function/migrated_0014/expected.json b/test/fixtures/esprima/declaration-function/migrated_0014/expected.json index cc976d4819..9b336de80e 100644 --- a/test/fixtures/esprima/declaration-function/migrated_0014/expected.json +++ b/test/fixtures/esprima/declaration-function/migrated_0014/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "test" }, "name": "test" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/declaration-let/migrated_0000/expected.json b/test/fixtures/esprima/declaration-let/migrated_0000/expected.json index 9e7caa0016..76753120a1 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0000/expected.json +++ b/test/fixtures/esprima/declaration-let/migrated_0000/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -78,6 +79,7 @@ ], "kind": "let" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-let/migrated_0001/expected.json b/test/fixtures/esprima/declaration-let/migrated_0001/expected.json index 1e0f4d8fa5..25e1548716 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0001/expected.json +++ b/test/fixtures/esprima/declaration-let/migrated_0001/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -93,8 +94,10 @@ ], "kind": "let" } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/declaration-let/migrated_0002/expected.json b/test/fixtures/esprima/declaration-let/migrated_0002/expected.json index e34ed2023b..1e45a1303f 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0002/expected.json +++ b/test/fixtures/esprima/declaration-let/migrated_0002/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/declaration-let/migrated_0003/expected.json b/test/fixtures/esprima/declaration-let/migrated_0003/expected.json index 6cf98a59bd..75f9f04288 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0003/expected.json +++ b/test/fixtures/esprima/declaration-let/migrated_0003/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -135,7 +136,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -186,7 +188,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "z" }, "name": "z" }, diff --git a/test/fixtures/esprima/directive-prolog/migrated_0000/expected.json b/test/fixtures/esprima/directive-prolog/migrated_0000/expected.json index c6d4b5de2b..e7c92d32b5 100644 --- a/test/fixtures/esprima/directive-prolog/migrated_0000/expected.json +++ b/test/fixtures/esprima/directive-prolog/migrated_0000/expected.json @@ -73,6 +73,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "i" }, "name": "i" }, @@ -177,7 +179,8 @@ }, "arguments": [], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json b/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json index 1acd32f8f8..4530bdb97f 100644 --- a/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json +++ b/test/fixtures/esprima/directive-prolog/migrated_0001/expected.json @@ -73,6 +73,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "i" }, "name": "i" }, @@ -177,7 +179,8 @@ }, "arguments": [], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/.invalid-elision-after-rest/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/.invalid-elision-after-rest/expected.json deleted file mode 100644 index aa98014263..0000000000 --- a/test/fixtures/esprima/es2015-array-binding-pattern/.invalid-elision-after-rest/expected.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "expression": { - "type": "ArrowFunctionExpression", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "id": null, - "generator": false, - "expression": true, - "params": [ - { - "type": "ArrayPattern", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "elements": [ - { - "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "name": "a" - }, - { - "type": "RestElement", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "argument": { - "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "name": "b" - } - } - ] - } - ], - "body": { - "type": "Literal", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "value": 0, - "rawValue": 0, - "raw": "0" - } - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/expected.json index 24fe25f6c7..592f6f4c3a 100644 --- a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/expected.json +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "ArrayPattern", @@ -87,7 +88,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/expected.json index 38ef2920e8..40992a4383 100644 --- a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/expected.json +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "ArrayPattern", @@ -87,7 +88,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -103,7 +105,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/expected.json index 74654fe30a..99f74f62d8 100644 --- a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/expected.json +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "ArrayPattern", @@ -87,7 +88,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/expected.json index fe13d83e4a..bf9322b67a 100644 --- a/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/expected.json +++ b/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "ArrayPattern", diff --git a/test/fixtures/esprima/es2015-array-binding-pattern/elision/expected.json b/test/fixtures/esprima/es2015-array-binding-pattern/elision/expected.json index 293ba53fee..cf5275647d 100644 --- a/test/fixtures/esprima/es2015-array-binding-pattern/elision/expected.json +++ b/test/fixtures/esprima/es2015-array-binding-pattern/elision/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "ArrayPattern", diff --git a/test/fixtures/esprima/es2015-array-pattern/elision/expected.json b/test/fixtures/esprima/es2015-array-pattern/elision/expected.json index 33b9e60b18..c87cb31e23 100644 --- a/test/fixtures/esprima/es2015-array-pattern/elision/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/elision/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/expected.json b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/expected.json index 85e1ffb837..fcf997f128 100644 --- a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -102,12 +103,14 @@ "column": 21 } }, - "body": [] + "body": [], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/expected.json b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/expected.json index 495f1eefe4..eba23577ef 100644 --- a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ArrayPattern", @@ -92,9 +94,11 @@ "column": 17 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/expected.json b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/expected.json index 969c550a6a..abda652078 100644 --- a/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/expected.json @@ -93,6 +93,7 @@ ], "kind": "let" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-array-pattern/hole/expected.json b/test/fixtures/esprima/es2015-array-pattern/hole/expected.json index af02d62272..1c73e74ba2 100644 --- a/test/fixtures/esprima/es2015-array-pattern/hole/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/hole/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -101,7 +102,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json b/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json index aa2233a73e..c9f2745187 100644 --- a/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/patterned-catch/expected.json @@ -100,7 +100,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -116,7 +117,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -164,7 +166,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "c" }, "name": "c" }, @@ -180,9 +183,13 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "c" }, "name": "c" + }, + "extra": { + "shorthand": true } }, { @@ -214,7 +221,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "d" }, "name": "d" }, @@ -244,7 +252,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -299,7 +308,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -329,7 +339,8 @@ "end": { "line": 1, "column": 36 - } + }, + "identifierName": "g" }, "name": "g" }, @@ -384,7 +395,8 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "h" }, "name": "h" }, @@ -414,7 +426,8 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "h" }, "name": "h" }, @@ -430,10 +443,14 @@ "end": { "line": 1, "column": 43 - } + }, + "identifierName": "i" }, "name": "i" } + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/esprima/es2015-array-pattern/rest/expected.json b/test/fixtures/esprima/es2015-array-pattern/rest/expected.json index 2c0a36d06f..89324548bf 100644 --- a/test/fixtures/esprima/es2015-array-pattern/rest/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/rest/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/esprima/es2015-array-pattern/tailing-hold/expected.json b/test/fixtures/esprima/es2015-array-pattern/tailing-hold/expected.json index 6cd7a04e5a..cfeb0c0e53 100644 --- a/test/fixtures/esprima/es2015-array-pattern/tailing-hold/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/tailing-hold/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/expected.json b/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/expected.json index 8d669b0c72..1d7d31be70 100644 --- a/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/expected.json @@ -114,7 +114,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-array-pattern/with-default-fn/expected.json b/test/fixtures/esprima/es2015-array-pattern/with-default-fn/expected.json index 0e0ab6da3b..187faa482d 100644 --- a/test/fixtures/esprima/es2015-array-pattern/with-default-fn/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/with-default-fn/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ArrayPattern", @@ -102,7 +104,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json b/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json index 5e393f5bf2..7b5862ff98 100644 --- a/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json +++ b/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/expected.json @@ -116,7 +116,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -132,9 +133,13 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/expected.json b/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/expected.json index 8a16817fc6..937d51b638 100644 --- a/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -118,7 +121,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "c" }, "name": "c" } diff --git a/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/expected.json b/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/expected.json index 30aa46f59e..1ab3f26f36 100644 --- a/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "RestElement", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0000/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0000/expected.json index 6b22652418..9910aa18c4 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0000/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [], "body": { "type": "StringLiteral", diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0001/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0001/expected.json index 070478ffa3..b6a6ef550a 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0001/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0001/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "e" }, "name": "e" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0002/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0002/expected.json index 71885e218e..0d66821115 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0002/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "e" }, "name": "e" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0003/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0003/expected.json index 57366e881f..36e04398ee 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0003/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0003/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0004/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0004/expected.json index 5644e19a05..54989111af 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0004/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0004/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "e" }, "name": "e" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json index d79ff6492c..0931f56cf1 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0005/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "e" }, "name": "e" } @@ -121,7 +123,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "property" }, "name": "property" }, @@ -148,7 +151,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 5 } } } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0006/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0006/expected.json index a7d846ffb6..93d45404a4 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0006/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0006/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "e" }, "name": "e" } @@ -153,7 +155,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "label" }, "name": "label" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0007/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0007/expected.json index 8eea5108a9..78728a0062 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0007/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0007/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0008/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0008/expected.json index d3ed02a634..e47019cdb6 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0008/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0008/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -138,7 +140,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -155,7 +158,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "x" }, "name": "x" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0009/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0009/expected.json index 6e5b95dce8..b7e7b61001 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0009/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0009/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "eval" }, "name": "eval" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0010/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0010/expected.json index 556e95a3ac..1f49c57e2d 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0010/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0010/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "arguments" }, "name": "arguments" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0011/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0011/expected.json index 6ba8419a8b..a2bf196ca0 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0011/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0011/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0012/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0012/expected.json index 6e06ca49e2..d912fa2794 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0012/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0012/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "eval" }, "name": "eval" }, @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0013/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0013/expected.json index f280cb57bf..84f8889f2f 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0013/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0013/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "eval" }, "name": "eval" }, diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0014/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0014/expected.json index 43ee9f5e11..31928b1851 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0014/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0014/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "eval" }, "name": "eval" }, @@ -102,7 +104,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0015/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0015/expected.json index b565e367ee..cab6510eaf 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0015/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0015/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" } @@ -89,12 +91,14 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0016/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0016/expected.json index 03125c85dd..5b9f51fa62 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0016/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0016/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" } @@ -94,6 +96,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -107,7 +110,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0017/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0017/expected.json index 7d5558cdaf..864245ed88 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0017/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0017/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" } @@ -94,6 +96,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -107,7 +110,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -123,7 +127,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "z" }, "name": "z" } @@ -155,7 +160,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -171,7 +177,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -187,17 +194,20 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "z" }, "name": "z" } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 18 } }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 7 } } } diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0018/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0018/expected.json index 001ee4b78f..d6a7efe40f 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0018/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0018/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -105,12 +107,14 @@ "column": 12 } }, - "body": [] + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0019/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0019/expected.json index 6abd542b88..e5022056df 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0019/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0019/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -103,7 +105,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -119,7 +122,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "y" }, "name": "y" } @@ -138,12 +142,14 @@ "column": 16 } }, - "body": [] + "body": [], + "directives": [] } } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/migrated_0020/expected.json b/test/fixtures/esprima/es2015-arrow-function/migrated_0020/expected.json index c0edf43c28..b8563aeaae 100644 --- a/test/fixtures/esprima/es2015-arrow-function/migrated_0020/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/migrated_0020/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "sun" }, "name": "sun" } @@ -89,12 +91,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "earth" }, "name": "earth" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/expected.json b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/expected.json index 10130f3578..1df1b8a0fb 100644 --- a/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/expected.json +++ b/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern/expected.json @@ -27,6 +27,7 @@ } }, "sourceType": "script", - "body": [] + "body": [], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/.migrated_0026/expected.json b/test/fixtures/esprima/es2015-class/.migrated_0026/expected.json deleted file mode 100644 index c69f6a312a..0000000000 --- a/test/fixtures/esprima/es2015-class/.migrated_0026/expected.json +++ /dev/null @@ -1,168 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "ClassDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "id": { - "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "name": "A" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 8, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "body": [ - { - "type": "ClassMethod", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "computed": false, - "key": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "a" - }, - "static": false, - "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "name": "eval" - } - ], - "body": { - "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "body": [] - } - } - } - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0000/expected.json b/test/fixtures/esprima/es2015-class/migrated_0000/expected.json index 9be73d0dda..79c113a526 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0000/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -76,6 +77,7 @@ "body": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0001/expected.json b/test/fixtures/esprima/es2015-class/migrated_0001/expected.json index 0884478b03..e97e6d4957 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0001/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0001/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, diff --git a/test/fixtures/esprima/es2015-class/migrated_0002/expected.json b/test/fixtures/esprima/es2015-class/migrated_0002/expected.json index 13ae4c94f1..4827f6ca09 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0002/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -76,6 +77,7 @@ "body": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0003/expected.json b/test/fixtures/esprima/es2015-class/migrated_0003/expected.json index dbd2563e9f..e6f951248c 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0003/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0003/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -76,6 +77,7 @@ "body": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-class/migrated_0004/expected.json b/test/fixtures/esprima/es2015-class/migrated_0004/expected.json index 3e510efdc1..1998fa25fd 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0004/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0004/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 14 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0005/expected.json b/test/fixtures/esprima/es2015-class/migrated_0005/expected.json index 1ec03c3f48..899e4f89fc 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0005/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0005/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 14 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 19 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "b" }, "name": "b" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0006/expected.json b/test/fixtures/esprima/es2015-class/migrated_0006/expected.json index c883c50114..aee3a382dc 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0006/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0006/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 14 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 20 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "b" }, "name": "b" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0007/expected.json b/test/fixtures/esprima/es2015-class/migrated_0007/expected.json index 57df44f925..30c3a5f4e6 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0007/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0007/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 14 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 20 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "b" }, "name": "b" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0008/expected.json b/test/fixtures/esprima/es2015-class/migrated_0008/expected.json index 129657a7fc..fc5dd03053 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0008/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0008/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 15 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 21 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "b" }, "name": "b" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0009/expected.json b/test/fixtures/esprima/es2015-class/migrated_0009/expected.json index aa0a5f9344..163cde64f1 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0009/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0009/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,8 @@ "column": 19 } }, + "static": false, + "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -101,15 +104,15 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "static" }, "name": "static" }, - "static": false, - "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0010/expected.json b/test/fixtures/esprima/es2015-class/migrated_0010/expected.json index 92e8ef8e43..123b5826fe 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0010/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0010/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 18 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": false, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 29 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "b" }, "name": "b" }, - "static": false, "kind": "set", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -178,7 +183,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "c" }, "name": "c" } diff --git a/test/fixtures/esprima/es2015-class/migrated_0011/expected.json b/test/fixtures/esprima/es2015-class/migrated_0011/expected.json index c6498e9b27..08bf6cfa7a 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0011/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0011/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 21 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 38 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": true, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -198,6 +203,7 @@ "column": 56 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -211,15 +217,16 @@ "end": { "line": 1, "column": 51 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": true, "kind": "set", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -233,7 +240,8 @@ "end": { "line": 1, "column": 53 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/esprima/es2015-class/migrated_0012/expected.json b/test/fixtures/esprima/es2015-class/migrated_0012/expected.json index fa54d94267..cf546974f2 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0012/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0012/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 21 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0013/expected.json b/test/fixtures/esprima/es2015-class/migrated_0013/expected.json index c7ff2d5228..f0fd394ac8 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0013/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0013/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 23 } }, + "static": true, "computed": true, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0014/expected.json b/test/fixtures/esprima/es2015-class/migrated_0014/expected.json index 3a78f1bd7d..1ff1dcca26 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0014/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0014/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 22 } }, + "static": true, "computed": true, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 37 } }, + "static": true, "computed": true, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "b" }, "name": "b" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0015/expected.json b/test/fixtures/esprima/es2015-class/migrated_0015/expected.json index ade3ae124b..fffddf1e76 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0015/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0015/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 26 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "static" }, "name": "static" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0016/expected.json b/test/fixtures/esprima/es2015-class/migrated_0016/expected.json index 376ca238f8..f382b98ada 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0016/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0016/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "A" }, "name": "A" }, diff --git a/test/fixtures/esprima/es2015-class/migrated_0017/expected.json b/test/fixtures/esprima/es2015-class/migrated_0017/expected.json index 2a2d1f81f9..ae929ebe00 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0017/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0017/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 22 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "prototype" }, "name": "prototype" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0018/expected.json b/test/fixtures/esprima/es2015-class/migrated_0018/expected.json index 8a0d50c2c6..ef96011b27 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0018/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0018/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 24 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "constructor" }, "name": "constructor" }, - "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0019/expected.json b/test/fixtures/esprima/es2015-class/migrated_0019/expected.json index 72bb521716..9fc80e5ba4 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0019/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0019/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 26 } }, + "static": false, "computed": false, "key": { "type": "StringLiteral", @@ -109,11 +111,11 @@ }, "value": "constructor" }, - "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -147,6 +149,7 @@ "column": 46 } }, + "static": false, "computed": true, "key": { "type": "StringLiteral", @@ -168,11 +171,11 @@ }, "value": "constructor" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0020/expected.json b/test/fixtures/esprima/es2015-class/migrated_0020/expected.json index 8ee060397d..ae2168a01e 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0020/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0020/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 31 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "constructor" }, "name": "constructor" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -143,6 +146,7 @@ "column": 54 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -156,15 +160,16 @@ "end": { "line": 1, "column": 50 - } + }, + "identifierName": "constructor" }, "name": "constructor" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0021/expected.json b/test/fixtures/esprima/es2015-class/migrated_0021/expected.json index 05b3f0a4ac..3b05492ff7 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0021/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0021/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ "column": 33 } }, + "static": true, "computed": true, "key": { "type": "StringLiteral", @@ -109,11 +111,11 @@ }, "value": "prototype" }, - "static": true, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-class/migrated_0022/expected.json b/test/fixtures/esprima/es2015-class/migrated_0022/expected.json index 0df98d2cb5..1fd506aabc 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0022/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0022/expected.json @@ -75,7 +75,8 @@ "body": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-class/migrated_0023/expected.json b/test/fixtures/esprima/es2015-class/migrated_0023/expected.json index f639d9d497..10c2f74536 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0023/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0023/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -90,7 +91,8 @@ "body": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-class/migrated_0024/expected.json b/test/fixtures/esprima/es2015-class/migrated_0024/expected.json index 79fb874e63..a7903dab31 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0024/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0024/expected.json @@ -94,7 +94,8 @@ "body": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-class/migrated_0025/expected.json b/test/fixtures/esprima/es2015-class/migrated_0025/expected.json index 0e93246761..fd18daa3e9 100644 --- a/test/fixtures/esprima/es2015-class/migrated_0025/expected.json +++ b/test/fixtures/esprima/es2015-class/migrated_0025/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -109,7 +110,8 @@ "body": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.json b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.json index 62a790d784..e1465d0c7d 100644 --- a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "y" }, "name": "y" }, diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/expected.json b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/expected.json index b6a422f551..a0c1096c6f 100644 --- a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/expected.json +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -87,7 +89,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json index 71590f27e6..9d6157c40e 100644 --- a/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -138,6 +140,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -165,7 +168,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.json index 21bd961454..0821544b30 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -100,7 +101,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -131,7 +133,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.json index bdac56e368..759556e093 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/member-expr-in-rest/expected.json @@ -112,7 +112,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.json index c7ff8b5b5c..226440f306 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-assignment/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -180,7 +182,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "c" }, "name": "c" }, @@ -224,7 +227,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json index 8420dbe0e7..fc37f6abce 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/expected.json @@ -116,7 +116,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -146,7 +147,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -162,10 +164,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "b" }, "name": "b" } + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.json index a27719de05..7da592c59d 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "a" }, "name": "a" } diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.json index 96aef38f6b..fc3579f72d 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/expected.json @@ -94,7 +94,8 @@ "value": 0 }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json index 4bc7411940..327467fdf6 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/nested-cover-grammar/expected.json @@ -401,7 +401,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -431,7 +432,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -461,7 +463,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -487,6 +490,9 @@ }, "computed": true } + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json index 8e0054a6b2..7bd635bfb1 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/object-pattern-assignment/expected.json @@ -101,7 +101,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,9 +118,13 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } }, { @@ -151,7 +156,8 @@ "end": { "line": 3, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -167,7 +173,8 @@ "end": { "line": 3, "column": 7 - } + }, + "identifierName": "a" }, "name": "a" } @@ -201,7 +208,8 @@ "end": { "line": 4, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -231,7 +239,8 @@ "end": { "line": 4, "column": 7 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -247,7 +256,8 @@ "end": { "line": 4, "column": 9 - } + }, + "identifierName": "a" }, "name": "a" } @@ -282,7 +292,8 @@ "end": { "line": 5, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -330,7 +341,8 @@ "end": { "line": 5, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -346,9 +358,13 @@ "end": { "line": 5, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } } ] @@ -383,7 +399,8 @@ "end": { "line": 6, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -427,7 +444,8 @@ "end": { "line": 6, "column": 15 - } + }, + "identifierName": "some_call" }, "name": "some_call" }, @@ -445,7 +463,8 @@ "end": { "line": 6, "column": 19 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -481,7 +500,8 @@ "end": { "line": 7, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -526,7 +546,8 @@ "end": { "line": 7, "column": 12 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -556,7 +577,8 @@ "value": 0 }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-export-declaration/export-const-number/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-const-number/expected.json index 388b1fb864..db5aee3169 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-const-number/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-const-number/expected.json @@ -85,7 +85,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "foo" }, "name": "foo" }, diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-array/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-array/expected.json index 50cc489ebb..b811865d67 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-default-array/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-array/expected.json @@ -59,6 +59,7 @@ "elements": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-expression/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-expression/expected.json index abeb127a32..faff2790a2 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-default-expression/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-expression/expected.json @@ -98,7 +98,8 @@ "value": 2 }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 15 } } } diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-function/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-function/expected.json index 364e85431c..3c9a9fc01d 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-default-function/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-function/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/expected.json index 904f0ed8d9..73c18e7a0a 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -89,10 +91,12 @@ "column": 32 } }, - "body": [] + "body": [], + "directives": [] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json index dc93997faf..f9028639b0 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-object/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "foo" }, "name": "foo" }, diff --git a/test/fixtures/esprima/es2015-export-declaration/export-default-value/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-default-value/expected.json index 7425436e1f..67d273649e 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-default-value/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-default-value/expected.json @@ -54,11 +54,13 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "foo" }, "name": "foo" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-default/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-default/expected.json index 0a6a723e7b..4ff2253518 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-from-default/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-default/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "default" }, "name": "default" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "default" }, "name": "default" } diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/expected.json index 466e385f0b..f5e6ca5f81 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "default" }, "name": "default" } diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/expected.json index 7ae9c17b81..e7ef95b227 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/expected.json index 65c0fa29ea..a9e74dbdaa 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "default" }, "name": "default" } @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -133,7 +136,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/expected.json index 396665ef21..afc8737489 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/expected.json index 09fc23f85e..565c75960d 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -133,7 +136,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/expected.json index d9b4d3f5a5..a83b57f9d5 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-export-declaration/export-function/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-function/expected.json index 88b3e7b5b3..8a4161daa4 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-function/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-function/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -91,10 +93,12 @@ "column": 25 } }, - "body": [] + "body": [], + "directives": [] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-let-number/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-let-number/expected.json index a70b2d4788..b263cee065 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-let-number/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-let-number/expected.json @@ -85,7 +85,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "foo" }, "name": "foo" }, diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/expected.json index 9c84a45187..31cb80c31f 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "default" }, "name": "default" } @@ -94,6 +96,7 @@ ], "source": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/expected.json index 0b4b274d42..1ed1c02a52 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -94,6 +96,7 @@ ], "source": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/expected.json index 35d224c0d9..d23e39b3e5 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "default" }, "name": "default" } @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -133,7 +136,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -141,6 +145,7 @@ ], "source": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-empty/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-empty/expected.json index 7c7d2cfb8b..393a47ca6e 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-named-empty/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-empty/expected.json @@ -46,6 +46,7 @@ "specifiers": [], "source": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/expected.json index 923c934a26..b2d26747cb 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -94,6 +96,7 @@ ], "source": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/expected.json index 0694002dce..7344150952 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -133,7 +136,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -141,6 +145,7 @@ ], "source": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/expected.json index 745d2e9d0b..96213b5828 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/expected.json @@ -70,7 +70,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -133,7 +136,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -141,6 +145,7 @@ ], "source": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/expected.json index 130b99c96e..22cb4bf78a 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/expected.json @@ -85,7 +85,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -106,6 +107,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -121,7 +123,8 @@ "column": 31 } }, - "body": [] + "body": [], + "directives": [] } } } @@ -129,6 +132,7 @@ "kind": "var" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-export-declaration/export-var-number/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-var-number/expected.json index 7290654ceb..ce76b426cc 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-var-number/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-var-number/expected.json @@ -85,7 +85,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "foo" }, "name": "foo" }, diff --git a/test/fixtures/esprima/es2015-export-declaration/export-var/expected.json b/test/fixtures/esprima/es2015-export-declaration/export-var/expected.json index 22ba6ec97b..2ef2274598 100644 --- a/test/fixtures/esprima/es2015-export-declaration/export-var/expected.json +++ b/test/fixtures/esprima/es2015-export-declaration/export-var/expected.json @@ -85,7 +85,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -95,6 +96,7 @@ "kind": "var" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/expected.json index f81b113841..22a362cc56 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/expected.json @@ -42,6 +42,7 @@ "column": 22 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "p" }, "name": "p" }, @@ -114,7 +116,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "q" }, "name": "q" } @@ -137,7 +140,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "r" }, "name": "r" }, @@ -157,6 +161,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/expected.json index c174207c6b..f3e791fa62 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/expected.json @@ -42,6 +42,7 @@ "column": 18 } }, + "await": false, "left": { "type": "ArrayPattern", "start": 5, @@ -69,7 +70,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "p" }, "name": "p" }, @@ -85,7 +87,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "q" }, "name": "q" } @@ -103,7 +106,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "r" }, "name": "r" }, @@ -123,6 +127,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json index bf3b9e73b7..2f0291d7fa 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/expected.json @@ -42,6 +42,7 @@ "column": 24 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -131,9 +133,13 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } }, { @@ -165,7 +171,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -181,9 +188,13 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "y" }, "name": "y" + }, + "extra": { + "shorthand": true } } ] @@ -205,7 +216,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "z" }, "name": "z" }, diff --git a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json index 025d0acd2b..a9ec1dc8a2 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/expected.json @@ -42,6 +42,7 @@ "column": 18 } }, + "await": false, "left": { "type": "ObjectPattern", "start": 5, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -102,9 +104,13 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } }, { @@ -136,7 +142,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -152,9 +159,13 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "y" }, "name": "y" + }, + "extra": { + "shorthand": true } } ] @@ -171,7 +182,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "z" }, "name": "z" }, diff --git a/test/fixtures/esprima/es2015-for-of/for-of-with-const/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-with-const/expected.json index 7608d6e366..7633fb27cc 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of-with-const/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of-with-const/expected.json @@ -42,6 +42,7 @@ "column": 22 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -124,6 +127,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-with-let/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-with-let/expected.json index f48045b006..640ebe2cbf 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of-with-let/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of-with-let/expected.json @@ -42,6 +42,7 @@ "column": 20 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "z" }, "name": "z" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -124,6 +127,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of-with-var/expected.json b/test/fixtures/esprima/es2015-for-of/for-of-with-var/expected.json index 75eaef11cf..0333623699 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of-with-var/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of-with-var/expected.json @@ -42,6 +42,7 @@ "column": 20 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -124,6 +127,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/for-of/expected.json b/test/fixtures/esprima/es2015-for-of/for-of/expected.json index 8b229f61b2..f068e87b71 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of/expected.json @@ -32,7 +32,6 @@ "type": "ForOfStatement", "start": 0, "end": 13, - "await": false, "loc": { "start": { "line": 1, @@ -43,6 +42,7 @@ "column": 13 } }, + "await": false, "left": { "type": "Identifier", "start": 5, @@ -55,7 +55,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "p" }, "name": "p" }, @@ -71,7 +72,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "q" }, "name": "q" }, @@ -91,6 +93,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/let-of-of/expected.json b/test/fixtures/esprima/es2015-for-of/let-of-of/expected.json index 1af67a2a58..08ac0ccfbd 100644 --- a/test/fixtures/esprima/es2015-for-of/let-of-of/expected.json +++ b/test/fixtures/esprima/es2015-for-of/let-of-of/expected.json @@ -42,6 +42,7 @@ "column": 20 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "of" }, "name": "of" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "xyz" }, "name": "xyz" }, @@ -124,6 +127,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json b/test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json deleted file mode 100644 index 4b57db559b..0000000000 --- a/test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "expression": { - "type": "FunctionExpression", - "start": 1, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "id": null, - "generator": true, - "expression": false, - "params": [ - { - "type": "ObjectPattern", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "properties": [ - { - "type": "Property", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "name": "yield" - }, - "kind": "init", - "value": { - "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "name": "yield" - } - } - ] - } - ], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "body": [] - }, - "parenthesizedExpression": true - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/expected.json b/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/expected.json index 94810ff25f..2423e57fcf 100644 --- a/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": true, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -89,7 +92,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -105,7 +109,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "z" }, "name": "z" } @@ -124,9 +129,11 @@ "column": 25 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/expected.json b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/expected.json index 12653936f3..58db0aae3b 100644 --- a/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/expected.json b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/expected.json index ca953c366a..be45b3da43 100644 --- a/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-generator/generator-declaration/expected.json b/test/fixtures/esprima/es2015-generator/generator-declaration/expected.json index a222c7d25a..1218c2a65b 100644 --- a/test/fixtures/esprima/es2015-generator/generator-declaration/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-declaration/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -75,9 +77,11 @@ "column": 18 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/expected.json index edd55ba2ea..db8af8e978 100644 --- a/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [ { "type": "RestElement", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "x" }, "name": "x" } @@ -110,7 +112,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-with-params/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression-with-params/expected.json index dcddd48350..f7443b2b26 100644 --- a/test/fixtures/esprima/es2015-generator/generator-expression-with-params/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-expression-with-params/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -104,7 +107,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "z" }, "name": "z" } @@ -127,7 +131,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/expected.json index 15d56c524b..68ae729a2b 100644 --- a/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -104,7 +107,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "z" }, "name": "z" } @@ -165,7 +169,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "x" }, "name": "x" } @@ -175,7 +180,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/expected.json index 8a6fe27484..7ae471dd07 100644 --- a/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -130,7 +131,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-expression/expected.json b/test/fixtures/esprima/es2015-generator/generator-expression/expected.json index 9cb0b17ba1..c5418c003a 100644 --- a/test/fixtures/esprima/es2015-generator/generator-expression/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-expression/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -78,7 +79,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json index ef567c630d..74705225ac 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-params/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -94,6 +95,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -107,7 +109,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -123,7 +126,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -139,7 +143,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "z" }, "name": "z" } @@ -164,7 +169,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json index 419afbd644..e002528905 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -94,6 +95,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -167,7 +169,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json index e9df81eaa9..bbadbbe669 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -94,6 +95,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -167,7 +169,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json index 2b1db06974..d700b2546d 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -94,6 +95,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -183,7 +185,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json b/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json index 9bd0e0fc9b..addc5c802c 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method-with-yield/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -94,6 +95,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -148,7 +150,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/generator-method/expected.json b/test/fixtures/esprima/es2015-generator/generator-method/expected.json index 1edf3cf6b7..9b2aa0b7c9 100644 --- a/test/fixtures/esprima/es2015-generator/generator-method/expected.json +++ b/test/fixtures/esprima/es2015-generator/generator-method/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -94,6 +95,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,7 +117,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json b/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json index 39c163121b..d6bde8049a 100644 --- a/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json +++ b/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,8 @@ "column": 30 } }, + "static": true, + "kind": "method", "computed": true, "key": { "type": "Identifier", @@ -101,15 +104,15 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, - "kind": "method", "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json b/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json index 655985c272..14762b81ab 100644 --- a/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json +++ b/test/fixtures/esprima/es2015-generator/static-generator-method/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,8 @@ "column": 28 } }, + "static": true, + "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -101,15 +104,15 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, - "kind": "method", "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json b/test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json deleted file mode 100644 index e1bd544880..0000000000 --- a/test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "name": "await" - }, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "body": [] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/expected.json b/test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/expected.json deleted file mode 100644 index 8a8057346c..0000000000 --- a/test/fixtures/esprima/es2015-identifier/.invalid_lone_surrogate/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "value": "�!", - "rawValue": "�!", - "raw": "'\\uD800!'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/expected.json b/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/expected.json index 777d6344e3..f7072bac2a 100644 --- a/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/expected.json +++ b/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "゛" }, "name": "゛" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "゜" }, "name": "゜" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_all/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_all/expected.json index e71aacfe96..396895acb2 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_all/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_all/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "ABC" }, "name": "ABC" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_alef/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_math_alef/expected.json index 720e46270b..3f41b58b16 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_math_alef/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_alef/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "𞸀" }, "name": "𞸀" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/expected.json index aac895c761..07a2586b54 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "_𞸃" }, "name": "_𞸃" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/expected.json index aeab4c908f..026501e396 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "𞸊𞸋" }, "name": "𞸊𞸋" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/expected.json index f3f71d5dd7..358d88dfa9 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "𞸆_$" }, "name": "𞸆_$" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_part/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_part/expected.json index 538f851879..9e722d28de 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_part/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_part/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "ABC" }, "name": "ABC" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/escaped_start/expected.json b/test/fixtures/esprima/es2015-identifier/escaped_start/expected.json index 538f851879..9e722d28de 100644 --- a/test/fixtures/esprima/es2015-identifier/escaped_start/expected.json +++ b/test/fixtures/esprima/es2015-identifier/escaped_start/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "ABC" }, "name": "ABC" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/estimated/expected.json b/test/fixtures/esprima/es2015-identifier/estimated/expected.json index 52b66afb75..52be45f00f 100644 --- a/test/fixtures/esprima/es2015-identifier/estimated/expected.json +++ b/test/fixtures/esprima/es2015-identifier/estimated/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "℮" }, "name": "℮" }, @@ -78,6 +79,7 @@ ], "kind": "let" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/ethiopic_digits/expected.json b/test/fixtures/esprima/es2015-identifier/ethiopic_digits/expected.json index 3c1f5449e8..9e5692748e 100644 --- a/test/fixtures/esprima/es2015-identifier/ethiopic_digits/expected.json +++ b/test/fixtures/esprima/es2015-identifier/ethiopic_digits/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "_፩፪፫፬፭፮፯፰፱" }, "name": "_፩፪፫፬፭፮፯፰፱" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/math_alef/expected.json b/test/fixtures/esprima/es2015-identifier/math_alef/expected.json index 95e4a8ea91..5f832197cf 100644 --- a/test/fixtures/esprima/es2015-identifier/math_alef/expected.json +++ b/test/fixtures/esprima/es2015-identifier/math_alef/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "𞸀" }, "name": "𞸀" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/math_dal_part/expected.json b/test/fixtures/esprima/es2015-identifier/math_dal_part/expected.json index 177536551c..4b704fd162 100644 --- a/test/fixtures/esprima/es2015-identifier/math_dal_part/expected.json +++ b/test/fixtures/esprima/es2015-identifier/math_dal_part/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "_𞸃" }, "name": "_𞸃" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/math_kaf_lam/expected.json b/test/fixtures/esprima/es2015-identifier/math_kaf_lam/expected.json index d3db5f5c03..0cebe40a6d 100644 --- a/test/fixtures/esprima/es2015-identifier/math_kaf_lam/expected.json +++ b/test/fixtures/esprima/es2015-identifier/math_kaf_lam/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "𞸊𞸋" }, "name": "𞸊𞸋" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/math_zain_start/expected.json b/test/fixtures/esprima/es2015-identifier/math_zain_start/expected.json index 5124087f99..50094cc9b8 100644 --- a/test/fixtures/esprima/es2015-identifier/math_zain_start/expected.json +++ b/test/fixtures/esprima/es2015-identifier/math_zain_start/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "𞸆_$" }, "name": "𞸆_$" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/module_await/expected.json b/test/fixtures/esprima/es2015-identifier/module_await/expected.json index 33d6f24353..bd12000aa5 100644 --- a/test/fixtures/esprima/es2015-identifier/module_await/expected.json +++ b/test/fixtures/esprima/es2015-identifier/module_await/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "await" }, "name": "await" }, diff --git a/test/fixtures/esprima/es2015-identifier/valid_await/expected.json b/test/fixtures/esprima/es2015-identifier/valid_await/expected.json index 26afe27079..096230269c 100644 --- a/test/fixtures/esprima/es2015-identifier/valid_await/expected.json +++ b/test/fixtures/esprima/es2015-identifier/valid_await/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "await" }, "name": "await" }, @@ -104,11 +105,13 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "await" }, "name": "await", "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 11 } } } diff --git a/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json b/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json index 0fb54a0f5f..574f473102 100644 --- a/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json +++ b/test/fixtures/esprima/es2015-identifier/weierstrass/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "℘" }, "name": "℘" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/expected.json b/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/expected.json index b6bb7d481d..73debf7d79 100644 --- a/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/expected.json +++ b/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "℘℘" }, "name": "℘℘" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/expected.json index 918d5dc76f..c66526e4bd 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -100,7 +101,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/expected.json index 1481257a6e..2fba15cd78 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -100,7 +101,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default-as/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-default-as/expected.json index 90e760b5d0..5e065a6338 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-default-as/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-default-as/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "default" }, "name": "default" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-default/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-default/expected.json index 68eab4b614..f7c22db61e 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-default/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-default/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-jquery/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-jquery/expected.json index d1465085b3..cf96958292 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-jquery/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-jquery/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "$" }, "name": "$" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/expected.json index 158d42da07..da89ac26b6 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "baz" }, "name": "baz" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/expected.json index a3c950ab9c..ca548c6d5c 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "baz" }, "name": "baz" } @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "xyz" }, "name": "xyz" }, @@ -132,7 +135,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "xyz" }, "name": "xyz" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/expected.json index d328366be5..26095a68b1 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/expected.json index fa924672aa..95522ee106 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "baz" }, "name": "baz" }, @@ -132,7 +135,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "baz" }, "name": "baz" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/expected.json index 4cffe066fd..b4885c5259 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "baz" }, "name": "baz" }, @@ -132,7 +135,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "baz" }, "name": "baz" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/expected.json index cdb990cbdc..9cbe3e0b32 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/expected.json b/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/expected.json index 378e45b83b..518aaeb40a 100644 --- a/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/expected.json +++ b/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "null" }, "name": "null" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "nil" }, "name": "nil" } diff --git a/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/expected.json b/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/expected.json index 929eaa9eab..5841ab30aa 100644 --- a/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "answer" }, "name": "answer" }, @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "t" }, "name": "t" }, diff --git a/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/expected.json b/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/expected.json deleted file mode 100644 index c2ab0aba1b..0000000000 --- a/test/fixtures/esprima/es2015-meta-property/.invalid-new-target/expected.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "name": "x" - }, - "init": { - "type": "MetaProperty", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "meta": { - "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "name": "new" - }, - "property": { - "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "target" - } - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/assign-new-target/expected.json b/test/fixtures/esprima/es2015-meta-property/assign-new-target/expected.json index e909c85c33..98424401bd 100644 --- a/test/fixtures/esprima/es2015-meta-property/assign-new-target/expected.json +++ b/test/fixtures/esprima/es2015-meta-property/assign-new-target/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,7 +119,8 @@ "end": { "line": 2, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -147,7 +150,8 @@ "end": { "line": 2, "column": 15 - } + }, + "identifierName": "new" }, "name": "new" }, @@ -163,7 +167,8 @@ "end": { "line": 2, "column": 22 - } + }, + "identifierName": "target" }, "name": "target" } @@ -172,9 +177,11 @@ ], "kind": "let" } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/new-new-target/expected.json b/test/fixtures/esprima/es2015-meta-property/new-new-target/expected.json index 545d3f05a9..be413af467 100644 --- a/test/fixtures/esprima/es2015-meta-property/new-new-target/expected.json +++ b/test/fixtures/esprima/es2015-meta-property/new-new-target/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -130,7 +132,8 @@ "end": { "line": 2, "column": 11 - } + }, + "identifierName": "new" }, "name": "new" }, @@ -146,7 +149,8 @@ "end": { "line": 2, "column": 18 - } + }, + "identifierName": "target" }, "name": "target" } @@ -154,9 +158,11 @@ "arguments": [] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-declaration/expected.json b/test/fixtures/esprima/es2015-meta-property/new-target-declaration/expected.json index 154850a47c..1bac964983 100644 --- a/test/fixtures/esprima/es2015-meta-property/new-target-declaration/expected.json +++ b/test/fixtures/esprima/es2015-meta-property/new-target-declaration/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,7 +118,8 @@ "end": { "line": 2, "column": 7 - } + }, + "identifierName": "new" }, "name": "new" }, @@ -132,15 +135,18 @@ "end": { "line": 2, "column": 14 - } + }, + "identifierName": "target" }, "name": "target" } } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-expression/expected.json b/test/fixtures/esprima/es2015-meta-property/new-target-expression/expected.json index fdf1e48cdb..08af3f07a0 100644 --- a/test/fixtures/esprima/es2015-meta-property/new-target-expression/expected.json +++ b/test/fixtures/esprima/es2015-meta-property/new-target-expression/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -146,7 +148,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "new" }, "name": "new" }, @@ -162,19 +165,22 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "target" }, "name": "target" } } } - ] + ], + "directives": [] } } } ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-invoke/expected.json b/test/fixtures/esprima/es2015-meta-property/new-target-invoke/expected.json index 4480d5f16b..78ccbda879 100644 --- a/test/fixtures/esprima/es2015-meta-property/new-target-invoke/expected.json +++ b/test/fixtures/esprima/es2015-meta-property/new-target-invoke/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -130,7 +132,8 @@ "end": { "line": 2, "column": 7 - } + }, + "identifierName": "new" }, "name": "new" }, @@ -146,7 +149,8 @@ "end": { "line": 2, "column": 14 - } + }, + "identifierName": "target" }, "name": "target" } @@ -154,9 +158,11 @@ "arguments": [] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-meta-property/new-target-precedence/expected.json b/test/fixtures/esprima/es2015-meta-property/new-target-precedence/expected.json index 3a85fec1a1..bc3f8206fa 100644 --- a/test/fixtures/esprima/es2015-meta-property/new-target-precedence/expected.json +++ b/test/fixtures/esprima/es2015-meta-property/new-target-precedence/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -144,7 +146,8 @@ "end": { "line": 2, "column": 11 - } + }, + "identifierName": "new" }, "name": "new" }, @@ -160,7 +163,8 @@ "end": { "line": 2, "column": 18 - } + }, + "identifierName": "target" }, "name": "target" } @@ -170,9 +174,11 @@ "arguments": [] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json index 880dce74c2..ce0016fdc3 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0000/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "method" }, "name": "method" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json index 7d5dce4954..403f65e101 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0001/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "method" }, "name": "method" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -138,7 +141,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "test" }, "name": "test" } diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json index 1030bf0af2..cc11812169 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0002/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -129,6 +130,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json index 0b0d3f1c10..a8769bfc25 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0003/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "get" }, "name": "get" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json b/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json index b118b76443..98450690a7 100644 --- a/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json +++ b/test/fixtures/esprima/es2015-method-definition/migrated_0004/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "set" }, "name": "set" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json index 41fa69789a..194bb1af4a 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -135,7 +136,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -143,6 +145,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -191,7 +194,8 @@ "end": { "line": 1, "column": 52 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -199,6 +203,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -212,7 +217,8 @@ "end": { "line": 1, "column": 54 - } + }, + "identifierName": "x" }, "name": "x" } @@ -237,7 +243,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json index 73ee6c7acf..0cce78e2c4 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -135,7 +136,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -143,6 +145,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -164,7 +167,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json index 8213ba1bb4..afab4b37f8 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -135,7 +136,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -143,6 +145,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -164,7 +167,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json index 3e06b6b52c..920dce0155 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -135,7 +136,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -143,6 +145,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -156,7 +159,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "x" }, "name": "x" } @@ -181,7 +185,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json index a1524c4a1f..82b235c2bb 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/expected.json @@ -139,7 +139,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -147,6 +148,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -195,7 +197,8 @@ "end": { "line": 1, "column": 54 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -203,6 +206,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -216,7 +220,8 @@ "end": { "line": 1, "column": 56 - } + }, + "identifierName": "x" }, "name": "x" } @@ -241,7 +246,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json index 5fe032f20e..d5af9e236d 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/expected.json @@ -139,7 +139,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -147,6 +148,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -168,7 +170,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json index 2a6d87e4c9..b77f23777c 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/expected.json @@ -139,7 +139,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -147,6 +148,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -168,7 +170,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json index d0c7453baa..7efe87207c 100644 --- a/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json +++ b/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/expected.json @@ -139,7 +139,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" }, @@ -147,6 +148,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -160,7 +162,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "x" }, "name": "x" } @@ -185,7 +188,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json b/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json index 660265dd75..17d1d997d4 100644 --- a/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -133,9 +135,13 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "y" }, "name": "y" + }, + "extra": { + "shorthand": true } }, { @@ -167,7 +173,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "z" }, "name": "z" }, @@ -183,9 +190,13 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "z" }, "name": "z" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/esprima/es2015-object-pattern/elision/expected.json b/test/fixtures/esprima/es2015-object-pattern/elision/expected.json index 5aa022ac3f..567e7248c2 100644 --- a/test/fixtures/esprima/es2015-object-pattern/elision/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/elision/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/expected.json b/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/expected.json index 360729bf4f..33414a4e30 100644 --- a/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -102,12 +103,14 @@ "column": 21 } }, - "body": [] + "body": [], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-fn/expected.json b/test/fixtures/esprima/es2015-object-pattern/empty-fn/expected.json index fc8aa6cdb9..62f2520c8c 100644 --- a/test/fixtures/esprima/es2015-object-pattern/empty-fn/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/empty-fn/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -92,9 +94,11 @@ "column": 17 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json b/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json index 85430cc73f..69927b7511 100644 --- a/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/expected.json @@ -42,6 +42,7 @@ "column": 18 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, diff --git a/test/fixtures/esprima/es2015-object-pattern/nested/expected.json b/test/fixtures/esprima/es2015-object-pattern/nested/expected.json index 2b66d83815..e4bc4272b8 100644 --- a/test/fixtures/esprima/es2015-object-pattern/nested/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/nested/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, diff --git a/test/fixtures/esprima/es2015-object-pattern/properties/expected.json b/test/fixtures/esprima/es2015-object-pattern/properties/expected.json index 45e9261374..4fff32b6b5 100644 --- a/test/fixtures/esprima/es2015-object-pattern/properties/expected.json +++ b/test/fixtures/esprima/es2015-object-pattern/properties/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } }, { @@ -151,7 +156,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -181,7 +187,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -205,6 +212,9 @@ }, "value": 0 } + }, + "extra": { + "shorthand": true } }, { @@ -236,7 +246,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "c" }, "name": "c" }, @@ -252,7 +263,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "d" }, "name": "d" } @@ -286,7 +298,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -316,7 +329,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -371,7 +385,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "g" }, "name": "g" }, @@ -402,7 +417,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "h" }, "name": "h" } diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/expected.json b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/expected.json index f95c3acfdb..8a3dd5608b 100644 --- a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0002/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "test" }, "name": "test" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/expected.json b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/expected.json index 8fe8a8579a..95b01a403f 100644 --- a/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/expected.json +++ b/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0006/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "test" }, "name": "test" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-rest-parameter/function-declaration/expected.json b/test/fixtures/esprima/es2015-rest-parameter/function-declaration/expected.json index 4a17d865f7..07716be5ae 100644 --- a/test/fixtures/esprima/es2015-rest-parameter/function-declaration/expected.json +++ b/test/fixtures/esprima/es2015-rest-parameter/function-declaration/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -103,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "b" }, "name": "b" } @@ -123,9 +127,11 @@ "column": 22 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.json b/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.json index d524d90df1..8c72a24d81 100644 --- a/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.json +++ b/test/fixtures/esprima/es2015-rest-parameter/function-expression/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -103,7 +105,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -133,7 +136,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "b" }, "name": "b" } @@ -153,11 +157,13 @@ "column": 24 } }, - "body": [] + "body": [], + "directives": [] } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json b/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json index b5c022b8a6..44a231cab5 100644 --- a/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json +++ b/test/fixtures/esprima/es2015-rest-parameter/object-method/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "o" }, "name": "o" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -138,6 +140,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -151,7 +154,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -181,7 +185,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "b" }, "name": "b" } diff --git a/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json index 18295991cb..2d6b8d4961 100644 --- a/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json +++ b/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "method" }, "name": "method" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "RestElement", @@ -152,7 +155,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "test" }, "name": "test" } diff --git a/test/fixtures/esprima/es2015-spread-element/call-multi-spread/expected.json b/test/fixtures/esprima/es2015-spread-element/call-multi-spread/expected.json index 2610b26d4f..da5f595f34 100644 --- a/test/fixtures/esprima/es2015-spread-element/call-multi-spread/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/call-multi-spread/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" } @@ -130,7 +132,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "y" }, "name": "y" } @@ -161,7 +164,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "z" }, "name": "z" } @@ -169,6 +173,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread-default/expected.json b/test/fixtures/esprima/es2015-spread-element/call-spread-default/expected.json index dbf33a3d90..acb386ac7c 100644 --- a/test/fixtures/esprima/es2015-spread-element/call-spread-default/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/call-spread-default/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "g" }, "name": "g" }, @@ -130,7 +132,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "h" }, "name": "h" }, @@ -146,7 +149,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "i" }, "name": "i" } @@ -155,6 +159,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread-first/expected.json b/test/fixtures/esprima/es2015-spread-element/call-spread-first/expected.json index 4200d9b278..3f66a557a0 100644 --- a/test/fixtures/esprima/es2015-spread-element/call-spread-first/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/call-spread-first/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" } @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -132,13 +135,15 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "z" }, "name": "z" } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread-number/expected.json b/test/fixtures/esprima/es2015-spread-element/call-spread-number/expected.json index bd72b46cfa..3d2342021a 100644 --- a/test/fixtures/esprima/es2015-spread-element/call-spread-number/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/call-spread-number/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "f" }, "name": "f" }, diff --git a/test/fixtures/esprima/es2015-spread-element/call-spread/expected.json b/test/fixtures/esprima/es2015-spread-element/call-spread/expected.json index f85b3967a4..c1106662f9 100644 --- a/test/fixtures/esprima/es2015-spread-element/call-spread/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/call-spread/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "g" }, "name": "g" } @@ -107,6 +109,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/new-multi-spread/expected.json b/test/fixtures/esprima/es2015-spread-element/new-multi-spread/expected.json index 8a3987d6e0..2289f83586 100644 --- a/test/fixtures/esprima/es2015-spread-element/new-multi-spread/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/new-multi-spread/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" } @@ -130,7 +132,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "y" }, "name": "y" } @@ -161,7 +164,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "z" }, "name": "z" } @@ -169,6 +173,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread-default/expected.json b/test/fixtures/esprima/es2015-spread-element/new-spread-default/expected.json index 79688da6aa..2281e8e385 100644 --- a/test/fixtures/esprima/es2015-spread-element/new-spread-default/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/new-spread-default/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "g" }, "name": "g" }, @@ -130,7 +132,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "h" }, "name": "h" }, @@ -146,7 +149,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "i" }, "name": "i" } @@ -155,6 +159,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread-first/expected.json b/test/fixtures/esprima/es2015-spread-element/new-spread-first/expected.json index 7075fa833c..c015f67ef3 100644 --- a/test/fixtures/esprima/es2015-spread-element/new-spread-first/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/new-spread-first/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" } @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -132,13 +135,15 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "z" }, "name": "z" } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread-number/expected.json b/test/fixtures/esprima/es2015-spread-element/new-spread-number/expected.json index 0b6b85b9b7..1fe99acde7 100644 --- a/test/fixtures/esprima/es2015-spread-element/new-spread-number/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/new-spread-number/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "f" }, "name": "f" }, diff --git a/test/fixtures/esprima/es2015-spread-element/new-spread/expected.json b/test/fixtures/esprima/es2015-spread-element/new-spread/expected.json index a5a4974201..72ba2c94f2 100644 --- a/test/fixtures/esprima/es2015-spread-element/new-spread/expected.json +++ b/test/fixtures/esprima/es2015-spread-element/new-spread/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "g" }, "name": "g" } @@ -107,6 +109,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/.invalid_super_id/expected.json b/test/fixtures/esprima/es2015-super-property/.invalid_super_id/expected.json deleted file mode 100644 index 051ec3a5b8..0000000000 --- a/test/fixtures/esprima/es2015-super-property/.invalid_super_id/expected.json +++ /dev/null @@ -1,232 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ClassDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, - "id": { - "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "name": "A" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 8, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, - "body": [ - { - "type": "ClassMethod", - "start": 14, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 27 - } - }, - "computed": false, - "key": { - "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "name": "foo" - }, - "static": false, - "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 17, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 27 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 27 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 25 - } - }, - "expression": { - "type": "BinaryExpression", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 25 - } - }, - "left": { - "type": "NewExpression", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 21 - } - }, - "callee": { - "type": "Super", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 21 - } - } - }, - "arguments": [] - }, - "operator": "+", - "right": { - "type": "Literal", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - }, - "value": 3, - "rawValue": 3, - "raw": "3" - } - } - } - ] - } - } - } - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json b/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json index 76dcbec057..6f97b22f32 100644 --- a/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json +++ b/test/fixtures/esprima/es2015-super-property/arrow_super/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -70,7 +71,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -103,6 +105,7 @@ "column": 5 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -116,15 +119,16 @@ "end": { "line": 2, "column": 15 - } + }, + "identifierName": "constructor" }, "name": "constructor" }, - "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -172,6 +176,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [], "body": { "type": "CallExpression", diff --git a/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json b/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json index aad408ba61..1e275d8625 100644 --- a/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json +++ b/test/fixtures/esprima/es2015-super-property/constructor_super/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -70,7 +71,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -103,6 +105,7 @@ "column": 5 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -116,15 +119,16 @@ "end": { "line": 2, "column": 15 - } + }, + "identifierName": "constructor" }, "name": "constructor" }, - "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-super-property/new_super/expected.json b/test/fixtures/esprima/es2015-super-property/new_super/expected.json index 4bf3b459c2..270481875a 100644 --- a/test/fixtures/esprima/es2015-super-property/new_super/expected.json +++ b/test/fixtures/esprima/es2015-super-property/new_super/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -70,7 +71,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -103,6 +105,7 @@ "column": 5 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -116,15 +119,16 @@ "end": { "line": 2, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -210,7 +214,8 @@ "end": { "line": 3, "column": 21 - } + }, + "identifierName": "bar" }, "name": "bar" }, diff --git a/test/fixtures/esprima/es2015-super-property/super_computed/expected.json b/test/fixtures/esprima/es2015-super-property/super_computed/expected.json index 5e81ff357e..0fc729cbe9 100644 --- a/test/fixtures/esprima/es2015-super-property/super_computed/expected.json +++ b/test/fixtures/esprima/es2015-super-property/super_computed/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -70,7 +71,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -103,6 +105,7 @@ "column": 5 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -116,15 +119,16 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "X" }, "name": "X" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/esprima/es2015-super-property/super_member/expected.json b/test/fixtures/esprima/es2015-super-property/super_member/expected.json index 9b939e582b..7b48047fec 100644 --- a/test/fixtures/esprima/es2015-super-property/super_member/expected.json +++ b/test/fixtures/esprima/es2015-super-property/super_member/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -70,7 +71,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -103,6 +105,7 @@ "column": 5 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -116,15 +119,16 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "X" }, "name": "X" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -196,7 +200,8 @@ "end": { "line": 3, "column": 22 - } + }, + "identifierName": "y" }, "name": "y" }, diff --git a/test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json b/test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json deleted file mode 100644 index 9ebd9cc590..0000000000 --- a/test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "expression": { - "type": "TemplateLiteral", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "value": { - "raw": "\\00", - "cooked": "\u0000" - }, - "tail": true - } - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/expected.json b/test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/expected.json deleted file mode 100644 index 7ffc243c53..0000000000 --- a/test/fixtures/esprima/es2015-template-literals/.strict-octal-literal/expected.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "expression": { - "type": "Literal", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "value": "use strict", - "rawValue": "use strict", - "raw": "'use strict'" - } - }, - { - "type": "ExpressionStatement", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "expression": { - "type": "TemplateLiteral", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "value": { - "raw": "\\00", - "cooked": "\u0000" - }, - "tail": true - } - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/dollar-sign/expected.json b/test/fixtures/esprima/es2015-template-literals/dollar-sign/expected.json index 094ec18811..8b41104a7b 100644 --- a/test/fixtures/esprima/es2015-template-literals/dollar-sign/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/dollar-sign/expected.json @@ -81,6 +81,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/escape-sequences/expected.json b/test/fixtures/esprima/es2015-template-literals/escape-sequences/expected.json index 3afaacea6e..3653254bf5 100644 --- a/test/fixtures/esprima/es2015-template-literals/escape-sequences/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/escape-sequences/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "source" }, "name": "source" }, diff --git a/test/fixtures/esprima/es2015-template-literals/line-terminators/expected.json b/test/fixtures/esprima/es2015-template-literals/line-terminators/expected.json index 836d521625..11aeefbebd 100644 --- a/test/fixtures/esprima/es2015-template-literals/line-terminators/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/line-terminators/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "source" }, "name": "source" }, diff --git a/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/expected.json b/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/expected.json index 1a1ed2bb2a..46f2eb813d 100644 --- a/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "source" }, "name": "source" }, diff --git a/test/fixtures/esprima/es2015-template-literals/new-expression/expected.json b/test/fixtures/esprima/es2015-template-literals/new-expression/expected.json index 08da84c059..76377676ec 100644 --- a/test/fixtures/esprima/es2015-template-literals/new-expression/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/new-expression/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "raw" }, "name": "raw" }, @@ -128,6 +129,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/expected.json b/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/expected.json index 1308a48aaa..9b083f0902 100644 --- a/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "raw" }, "name": "raw" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "name" }, "name": "name" } @@ -149,6 +151,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/expected.json b/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/expected.json index dd145facf5..38d9108763 100644 --- a/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "raw" }, "name": "raw" }, @@ -262,6 +263,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/tagged/expected.json b/test/fixtures/esprima/es2015-template-literals/tagged/expected.json index 3eabcd73c8..6b4305de3b 100644 --- a/test/fixtures/esprima/es2015-template-literals/tagged/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/tagged/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "raw" }, "name": "raw" }, @@ -112,6 +113,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/untagged/expected.json b/test/fixtures/esprima/es2015-template-literals/untagged/expected.json index f0f8b0bf3c..ad16fe02ef 100644 --- a/test/fixtures/esprima/es2015-template-literals/untagged/expected.json +++ b/test/fixtures/esprima/es2015-template-literals/untagged/expected.json @@ -81,6 +81,7 @@ ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/expected.json b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/expected.json index c6f9f2ce0e..8dd034ae3c 100644 --- a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/expected.json +++ b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0000/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "source" }, "name": "source" }, diff --git a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/expected.json b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/expected.json index 5c97440415..8f6e279539 100644 --- a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/expected.json +++ b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0001/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "source" }, "name": "source" }, diff --git a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/expected.json b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/expected.json index 05e4851182..b61b0b1bdc 100644 --- a/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/expected.json +++ b/test/fixtures/esprima/es2015-unicode-code-point-escape-sequence/migrated_0002/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "source" }, "name": "source" }, diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/expected.json deleted file mode 100644 index dd6a552b65..0000000000 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-arrow-default/expected.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 38 - } - }, - "id": { - "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "name": "g" - }, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 14, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 38 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 16, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "expression": { - "type": "ArrowFunctionExpression", - "start": 16, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "left": { - "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "x" - }, - "right": { - "type": "YieldExpression", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "delegate": false, - "argument": { - "type": "Literal", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "value": 42, - "rawValue": 42, - "raw": "42" - } - } - } - ], - "body": { - "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "body": [] - } - } - } - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json deleted file mode 100644 index 608a26d547..0000000000 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "expression": { - "type": "FunctionExpression", - "start": 1, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "id": { - "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "name": "yield" - }, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "body": [] - }, - "parenthesizedExpression": true - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json deleted file mode 100644 index df826e036e..0000000000 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "expression": { - "type": "FunctionExpression", - "start": 1, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "id": null, - "generator": true, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "name": "yield" - } - ], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [] - }, - "parenthesizedExpression": true - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json deleted file mode 100644 index e99f09b954..0000000000 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "expression": { - "type": "FunctionExpression", - "start": 1, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "id": null, - "generator": true, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "name": "x" - }, - { - "type": "RestElement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "argument": { - "type": "Identifier", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "name": "yield" - } - } - ], - "body": { - "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "body": [] - }, - "parenthesizedExpression": true - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json deleted file mode 100644 index a5588e4e19..0000000000 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "id": { - "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "name": "g" - }, - "generator": true, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "name": "yield" - } - ], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "body": [] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json deleted file mode 100644 index eb042938fb..0000000000 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "id": { - "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "name": "g" - }, - "generator": true, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "name": "a" - }, - { - "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "name": "b" - }, - { - "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "name": "c" - }, - { - "type": "RestElement", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "argument": { - "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "name": "yield" - } - } - ], - "body": { - "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "body": [] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json deleted file mode 100644 index 9f91e65aeb..0000000000 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "expression": { - "type": "AssignmentExpression", - "start": 15, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "operator": "=", - "left": { - "type": "ArrayPattern", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "elements": [ - { - "type": "Identifier", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "name": "yield" - } - ] - }, - "right": { - "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "name": "x" - }, - "extra": { - "parenthesized": true - } - } - } - ], - "directives": [ - { - "type": "Directive", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "value": { - "type": "DirectiveLiteral", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "raw": "\"use strict\"", - "value": "use strict" - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/expected.json deleted file mode 100644 index cab8ff9322..0000000000 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-default/expected.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "expression": { - "type": "Literal", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "value": "use strict", - "rawValue": "use strict", - "raw": "\"use strict\"" - } - }, - { - "type": "ExpressionStatement", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "expression": { - "type": "ArrowFunctionExpression", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "left": { - "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, - "name": "x" - }, - "right": { - "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "name": "yield" - } - } - ], - "body": { - "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "body": [] - } - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/expected.json b/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/expected.json deleted file mode 100644 index ce0cbfa1fb..0000000000 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-arrow-parameter-name/expected.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "expression": { - "type": "ArrowFunctionExpression", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "id": null, - "generator": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "name": "yield" - } - ], - "body": { - "type": "NumericLiteral", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "value": 42, - "rawValue": 42, - "raw": "42" - } - } - } - ], - "directives": [ - { - "type": "Directive", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "value": { - "type": "DirectiveLiteral", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - } - }, - "raw": "\"use strict\"", - "value": "use strict" - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.yield-generator-arrow-concise-body/expected.json b/test/fixtures/esprima/es2015-yield/.yield-generator-arrow-concise-body/expected.json deleted file mode 100644 index 4887c0fc44..0000000000 --- a/test/fixtures/esprima/es2015-yield/.yield-generator-arrow-concise-body/expected.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 35 - } - }, - "id": { - "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "name": "g" - }, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 14, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 35 - } - }, - "body": [ - { - "type": "ExpressionStatement", - "start": 16, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "expression": { - "type": "ArrowFunctionExpression", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "id": null, - "generator": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "x" - } - ], - "body": { - "type": "BinaryExpression", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "left": { - "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "name": "x" - }, - "operator": "*", - "right": { - "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "name": "yield" - } - } - } - } - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json b/test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json deleted file mode 100644 index e8b2f8224a..0000000000 --- a/test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json +++ /dev/null @@ -1,185 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "id": { - "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "name": "g" - }, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 14, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 44 - } - }, - "body": [ - { - "type": "VariableDeclaration", - "start": 16, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 20, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "id": { - "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "name": "z" - }, - "init": { - "type": "FunctionExpression", - "start": 24, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 38 - } - }, - "name": "yield" - } - ], - "body": { - "type": "BlockStatement", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "body": [] - } - } - } - ], - "kind": "var" - } - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json b/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json index 7a4fbd86f6..965e2ec8ef 100644 --- a/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-array-pattern/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "yield" }, "name": "yield" } @@ -102,12 +103,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/expected.json b/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/expected.json index 81505c98aa..979a5b2d8f 100644 --- a/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" } @@ -103,7 +105,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,13 +123,15 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "yield" }, "name": "yield" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/expected.json b/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/expected.json index 524a90fb9e..f21f16b122 100644 --- a/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "z" }, "name": "z" } @@ -132,7 +134,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -149,16 +152,19 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/expected.json b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/expected.json index 2058074918..4e9be7eb6c 100644 --- a/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -102,7 +104,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "yield" }, "name": "yield" } @@ -122,10 +125,12 @@ "column": 17 } }, - "body": [] + "body": [], + "directives": [] } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/expected.json b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/expected.json index ac4ee8bf0c..482f30d4af 100644 --- a/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "yield" }, "name": "yield" } diff --git a/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json b/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json index 09eb1bcbb8..3cf2edca58 100644 --- a/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-binding-element/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "yield" }, "name": "yield" } @@ -136,7 +138,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json index 7b85a9fef5..0799aa00f4 100644 --- a/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-binding-property/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "x" }, "name": "x" } @@ -136,7 +138,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/esprima/es2015-yield/yield-call-expression-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-call-expression-property/expected.json index 2e11c61b3c..96faaad623 100644 --- a/test/fixtures/esprima/es2015-yield/yield-call-expression-property/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-call-expression-property/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "g" }, "name": "g" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -130,7 +132,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "obj" }, "name": "obj" }, @@ -146,7 +149,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -155,9 +159,11 @@ "arguments": [] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-catch-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-catch-parameter/expected.json index 3cba41671f..1aaf0aa249 100644 --- a/test/fixtures/esprima/es2015-yield/yield-catch-parameter/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-catch-parameter/expected.json @@ -56,7 +56,8 @@ "column": 6 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -102,12 +104,14 @@ "column": 23 } }, - "body": [] + "body": [], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-expression-precedence/expected.json b/test/fixtures/esprima/es2015-yield/yield-expression-precedence/expected.json index 8a39ff485d..0af9249a29 100644 --- a/test/fixtures/esprima/es2015-yield/yield-expression-precedence/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-expression-precedence/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "g" }, "name": "g" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -147,7 +149,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -163,7 +166,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "b" }, "name": "b" } @@ -211,7 +215,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "c" }, "name": "c" }, @@ -227,7 +232,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "d" }, "name": "d" } @@ -245,16 +251,19 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "e" }, "name": "e" } ] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/expected.json index f16d4b50a4..1bcf0b31b8 100644 --- a/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "yield" }, "name": "yield" } @@ -92,9 +95,11 @@ "column": 20 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-function-declaration/expected.json b/test/fixtures/esprima/es2015-yield/yield-function-declaration/expected.json index 18ef7bd43a..7a94e29140 100644 --- a/test/fixtures/esprima/es2015-yield/yield-function-declaration/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-function-declaration/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "yield" }, "name": "yield" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -75,9 +77,11 @@ "column": 18 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/expected.json index 72a06d9cce..792d4b5170 100644 --- a/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -72,7 +73,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "yield" }, "name": "yield" } @@ -95,7 +97,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-yield/yield-function-expression/expected.json b/test/fixtures/esprima/es2015-yield/yield-function-expression/expected.json index a2138f73ef..69b03706fd 100644 --- a/test/fixtures/esprima/es2015-yield/yield-function-expression/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-function-expression/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "yield" }, "name": "yield" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -93,7 +95,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/expected.json index f9c4899032..92d1ed64ad 100644 --- a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "g" }, "name": "g" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -107,6 +109,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -134,7 +137,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -171,13 +175,16 @@ "column": 33 } }, - "body": [] + "body": [], + "directives": [] } } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/expected.json index 8ee47195d3..5e171cab8f 100644 --- a/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "g" }, "name": "g" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -107,6 +109,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -120,7 +123,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "z" }, "name": "z" } @@ -180,7 +184,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -197,19 +202,23 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-declaration/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-declaration/expected.json index 76d7225d05..b8920d91bb 100644 --- a/test/fixtures/esprima/es2015-yield/yield-generator-declaration/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-generator-declaration/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "yield" }, "name": "yield" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -75,9 +77,11 @@ "column": 19 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/expected.json index 272c0b0c3d..d9dc1ed5e4 100644 --- a/test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-generator-default-parameter/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "g" }, "name": "g" }, "generator": true, "expression": false, + "async": false, "params": [ { "type": "AssignmentPattern", @@ -87,7 +89,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -103,7 +106,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "yield" }, "name": "yield" } @@ -123,9 +127,11 @@ "column": 24 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json index 660094298e..9625fd5709 100644 --- a/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-generator-method/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -94,6 +95,7 @@ "id": null, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,7 +117,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json b/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json index b212d5a14f..ac7d7b8b51 100644 --- a/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "g" }, "name": "g" }, "generator": true, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -105,7 +107,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -121,7 +124,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/expected.json b/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/expected.json index ecbe7ba7c5..6de43b2eb8 100644 --- a/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "yield" }, "name": "yield" }, diff --git a/test/fixtures/esprima/es2015-yield/yield-member-expression-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-member-expression-property/expected.json index 091dac5d5d..fe001abdb5 100644 --- a/test/fixtures/esprima/es2015-yield/yield-member-expression-property/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-member-expression-property/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "g" }, "name": "g" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -131,7 +133,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "obj" }, "name": "obj" }, @@ -147,7 +150,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -155,9 +159,11 @@ } } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-method/expected.json b/test/fixtures/esprima/es2015-yield/yield-method/expected.json index 73a6d2827d..b10ddb8590 100644 --- a/test/fixtures/esprima/es2015-yield/yield-method/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-method/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -94,6 +95,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,7 +117,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json b/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json index f0dc7b4f27..b5c586eeee 100644 --- a/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -105,7 +107,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -121,7 +124,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/esprima/es2015-yield/yield-rest-parameter/expected.json b/test/fixtures/esprima/es2015-yield/yield-rest-parameter/expected.json index bfd5f8f9d2..90d608359f 100644 --- a/test/fixtures/esprima/es2015-yield/yield-rest-parameter/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-rest-parameter/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "RestElement", @@ -87,7 +89,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "yield" }, "name": "yield" } @@ -107,9 +110,11 @@ "column": 23 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json index 687e8f341a..d88ed08060 100644 --- a/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-strict-binding-property/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "x" }, "name": "x" } @@ -136,7 +138,8 @@ "end": { "line": 1, "column": 36 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json b/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json index e71a000bbe..bf006185f0 100644 --- a/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-strict-method/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -94,6 +95,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,7 +117,8 @@ } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 14 } } } diff --git a/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json b/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json index ef8158ed4e..0801ae0ade 100644 --- a/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-super-property/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -70,7 +71,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -103,6 +105,7 @@ "column": 39 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -116,15 +119,16 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "X" }, "name": "X" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -196,7 +200,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "yield" }, "name": "yield" }, diff --git a/test/fixtures/esprima/es2015-yield/yield-variable-declaration/expected.json b/test/fixtures/esprima/es2015-yield/yield-variable-declaration/expected.json index 2c21f2ba38..48b5015bb8 100644 --- a/test/fixtures/esprima/es2015-yield/yield-variable-declaration/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-variable-declaration/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "yield" }, "name": "yield" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/expected.json b/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/expected.json index be7cde28c8..d0d73e72ff 100644 --- a/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "g" }, "name": "g" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -124,9 +126,11 @@ } } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/yield-yield-expression/expected.json b/test/fixtures/esprima/es2015-yield/yield-yield-expression/expected.json index 299cd23813..d5adbff2e1 100644 --- a/test/fixtures/esprima/es2015-yield/yield-yield-expression/expected.json +++ b/test/fixtures/esprima/es2015-yield/yield-yield-expression/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "g" }, "name": "g" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -124,9 +126,11 @@ } } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-additive/migrated_0000/expected.json b/test/fixtures/esprima/expression-additive/migrated_0000/expected.json index 951a2c8573..4f4281d12b 100644 --- a/test/fixtures/esprima/expression-additive/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-additive/migrated_0000/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-additive/migrated_0001/expected.json b/test/fixtures/esprima/expression-additive/migrated_0001/expected.json index 4be8cd12bf..e715c38ccb 100644 --- a/test/fixtures/esprima/expression-additive/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-additive/migrated_0001/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-assignment/migrated_0000/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0000/expected.json index 712d4fd6c1..0f7d218b48 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0000/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json index 01bf6f0d71..08e10f09be 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0001/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "eval" }, "name": "eval" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json index 691796ca2f..588a74e579 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0002/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json index 4a01dfd629..3a99ca3eb6 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0003/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0004/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0004/expected.json index 1382a9b238..ec473b3207 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0004/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0005/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0005/expected.json index e2a6524e00..812fb07cc1 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0005/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0006/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0006/expected.json index 3fb8e6a109..4d6b358971 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0006/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0006/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0007/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0007/expected.json index 8b681331b0..26b624a7d4 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0007/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0007/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0008/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0008/expected.json index 827b99dbe0..441330c54c 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0008/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0008/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0009/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0009/expected.json index d27aeea8cc..1d99f52655 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0009/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0009/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0010/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0010/expected.json index ea2c4e00ff..10665e9e41 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0010/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0010/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0011/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0011/expected.json index 12db3bd78f..ffab2697d0 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0011/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0011/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0012/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0012/expected.json index 2b34e74553..a4a9088d93 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0012/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0012/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-assignment/migrated_0013/expected.json b/test/fixtures/esprima/expression-assignment/migrated_0013/expected.json index ef886d2c97..173d746401 100644 --- a/test/fixtures/esprima/expression-assignment/migrated_0013/expected.json +++ b/test/fixtures/esprima/expression-assignment/migrated_0013/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/expected.json b/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/expected.json index a21f7900f7..a479164a06 100644 --- a/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/expected.json b/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/expected.json index 9ff129d06b..e22094073c 100644 --- a/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/expected.json b/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/expected.json index 2c6c6a71aa..7cd159ef07 100644 --- a/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0000/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0000/expected.json index 43821da431..3dbff25ba9 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0000/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0001/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0001/expected.json index 7b3dce0fdb..b4327fea4a 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0001/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0002/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0002/expected.json index 313205c734..3e277f2fb0 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0002/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0003/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0003/expected.json index 076e9826f5..759ef90eeb 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0003/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0004/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0004/expected.json index 39a92de27e..51c2a9cc9c 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0004/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary-logical/migrated_0005/expected.json b/test/fixtures/esprima/expression-binary-logical/migrated_0005/expected.json index 27399a9c53..663534b1b4 100644 --- a/test/fixtures/esprima/expression-binary-logical/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-binary-logical/migrated_0005/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0000/expected.json b/test/fixtures/esprima/expression-binary/migrated_0000/expected.json index 102f5d3d69..8d5866efa2 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0000/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0001/expected.json b/test/fixtures/esprima/expression-binary/migrated_0001/expected.json index de56597e6a..bcc48922f6 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0001/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0002/expected.json b/test/fixtures/esprima/expression-binary/migrated_0002/expected.json index edc0351968..d4924593c3 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0002/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0003/expected.json b/test/fixtures/esprima/expression-binary/migrated_0003/expected.json index 74e0ab65b8..3b53c28f8f 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0003/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0004/expected.json b/test/fixtures/esprima/expression-binary/migrated_0004/expected.json index 510073e483..3eab6d0286 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0004/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0005/expected.json b/test/fixtures/esprima/expression-binary/migrated_0005/expected.json index 5e5fca2313..e929279a89 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0005/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0006/expected.json b/test/fixtures/esprima/expression-binary/migrated_0006/expected.json index dc0ac6b9bf..e0124c982f 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0006/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0006/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0007/expected.json b/test/fixtures/esprima/expression-binary/migrated_0007/expected.json index 4beef8dd3d..d891a4741e 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0007/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0007/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0008/expected.json b/test/fixtures/esprima/expression-binary/migrated_0008/expected.json index 9d743b0d39..07dfb3ff15 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0008/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0008/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0009/expected.json b/test/fixtures/esprima/expression-binary/migrated_0009/expected.json index 3e5a22a223..a251fd60d7 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0009/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0009/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0010/expected.json b/test/fixtures/esprima/expression-binary/migrated_0010/expected.json index 2174559e10..63a295482e 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0010/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0010/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0011/expected.json b/test/fixtures/esprima/expression-binary/migrated_0011/expected.json index 92c65557e6..8384ff1b91 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0011/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0011/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0012/expected.json b/test/fixtures/esprima/expression-binary/migrated_0012/expected.json index 188c481bfc..11335ea1d3 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0012/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0012/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0013/expected.json b/test/fixtures/esprima/expression-binary/migrated_0013/expected.json index 3c6c2f0817..1cfab365e3 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0013/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0013/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0014/expected.json b/test/fixtures/esprima/expression-binary/migrated_0014/expected.json index 48e47e4198..e819fc3506 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0014/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0014/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0015/expected.json b/test/fixtures/esprima/expression-binary/migrated_0015/expected.json index 0fa66acc0b..f14d54ace0 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0015/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0015/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0016/expected.json b/test/fixtures/esprima/expression-binary/migrated_0016/expected.json index c8df10d3d8..481b96d976 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0016/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0016/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-binary/migrated_0017/expected.json b/test/fixtures/esprima/expression-binary/migrated_0017/expected.json index c66d330503..ff26c296d7 100644 --- a/test/fixtures/esprima/expression-binary/migrated_0017/expected.json +++ b/test/fixtures/esprima/expression-binary/migrated_0017/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/expected.json b/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/expected.json index 7da984159e..1d480a3e1a 100644 --- a/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/expected.json b/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/expected.json index 51b1fefd9e..80210cee23 100644 --- a/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/expected.json b/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/expected.json index c61c63d02d..5edfbca9c7 100644 --- a/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-complex/migrated_0000/expected.json b/test/fixtures/esprima/expression-complex/migrated_0000/expected.json index 2158045bd1..d6a6a6320e 100644 --- a/test/fixtures/esprima/expression-complex/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-complex/migrated_0000/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -130,7 +132,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "c" }, "name": "c" }, @@ -161,7 +164,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "d" }, "name": "d" }, @@ -192,7 +196,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -223,7 +228,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -254,7 +260,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "g" }, "name": "g" }, @@ -285,7 +292,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "h" }, "name": "h" }, @@ -316,7 +324,8 @@ "end": { "line": 1, "column": 38 - } + }, + "identifierName": "i" }, "name": "i" }, @@ -347,7 +356,8 @@ "end": { "line": 1, "column": 42 - } + }, + "identifierName": "j" }, "name": "j" }, @@ -364,7 +374,8 @@ "end": { "line": 1, "column": 46 - } + }, + "identifierName": "k" }, "name": "k" } @@ -379,6 +390,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-conditional/migrated_0000/expected.json b/test/fixtures/esprima/expression-conditional/migrated_0000/expected.json index 11b669b4ea..ca2df57148 100644 --- a/test/fixtures/esprima/expression-conditional/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-conditional/migrated_0000/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "y" }, "name": "y" }, diff --git a/test/fixtures/esprima/expression-conditional/migrated_0001/expected.json b/test/fixtures/esprima/expression-conditional/migrated_0001/expected.json index 32682fb46d..7ec28110ed 100644 --- a/test/fixtures/esprima/expression-conditional/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-conditional/migrated_0001/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/esprima/expression-conditional/migrated_0002/expected.json b/test/fixtures/esprima/expression-conditional/migrated_0002/expected.json index 0cbf738808..efb8e82279 100644 --- a/test/fixtures/esprima/expression-conditional/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-conditional/migrated_0002/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -104,7 +105,8 @@ "extra": { "rawValue": 0, "raw": "0", - "parenthesized": true + "parenthesized": true, + "parenStart": 4 }, "value": 0 }, diff --git a/test/fixtures/esprima/expression-equality/migrated_0000/expected.json b/test/fixtures/esprima/expression-equality/migrated_0000/expected.json index c1e5bf26af..582e04e0dc 100644 --- a/test/fixtures/esprima/expression-equality/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-equality/migrated_0000/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-equality/migrated_0001/expected.json b/test/fixtures/esprima/expression-equality/migrated_0001/expected.json index 8eb45e6a10..507ec12519 100644 --- a/test/fixtures/esprima/expression-equality/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-equality/migrated_0001/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-equality/migrated_0002/expected.json b/test/fixtures/esprima/expression-equality/migrated_0002/expected.json index 2610f3986a..aada50d79c 100644 --- a/test/fixtures/esprima/expression-equality/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-equality/migrated_0002/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-equality/migrated_0003/expected.json b/test/fixtures/esprima/expression-equality/migrated_0003/expected.json index ab3b9424ab..a22ceaea6a 100644 --- a/test/fixtures/esprima/expression-equality/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-equality/migrated_0003/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-grouping/migrated_0000/expected.json b/test/fixtures/esprima/expression-grouping/migrated_0000/expected.json index 6971eb4e8a..12f91e395e 100644 --- a/test/fixtures/esprima/expression-grouping/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-grouping/migrated_0000/expected.json @@ -87,7 +87,8 @@ "extra": { "rawValue": 1, "raw": "1", - "parenthesized": true + "parenthesized": true, + "parenStart": 0 }, "value": 1 }, @@ -109,7 +110,8 @@ "extra": { "rawValue": 2, "raw": "2", - "parenthesized": true + "parenthesized": true, + "parenStart": 6 }, "value": 2 } diff --git a/test/fixtures/esprima/expression-grouping/migrated_0001/expected.json b/test/fixtures/esprima/expression-grouping/migrated_0001/expected.json index 8e7823f478..b38c445344 100644 --- a/test/fixtures/esprima/expression-grouping/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-grouping/migrated_0001/expected.json @@ -130,7 +130,8 @@ "extra": { "rawValue": 6, "raw": "6", - "parenthesized": true + "parenthesized": true, + "parenStart": 9 }, "value": 6 } diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0000/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0000/expected.json index 08c175955a..8a400eec78 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0000/expected.json @@ -68,13 +68,15 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "Button" }, "name": "Button" }, "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0001/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0001/expected.json index 782d5ea7e4..05c9a2e459 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0001/expected.json @@ -68,13 +68,15 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "Button" }, "name": "Button" }, "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0002/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0002/expected.json index 376081c391..42758a1f4e 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0002/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -91,6 +92,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0003/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0003/expected.json index 5c476aa6cf..99a0eebd01 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0003/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -91,6 +92,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0004/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0004/expected.json index 1b87993df9..b7777dc84a 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0004/expected.json @@ -96,7 +96,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -123,6 +125,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0005/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0005/expected.json index 952d418f50..ee47879eca 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0005/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -107,6 +109,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0006/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0006/expected.json index 7ace856b56..dc595a854e 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0006/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0006/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -107,6 +109,7 @@ "arguments": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0007/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0007/expected.json index 5e0c9c3c30..36a8e9983d 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0007/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0007/expected.json @@ -96,13 +96,15 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "foo" }, "name": "foo" }, "arguments": [], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } }, "property": { @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "bar" }, "name": "bar" }, diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0008/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0008/expected.json index c20918ced6..14abd247cf 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0008/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0008/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -101,13 +103,15 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "baz" }, "name": "baz" } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0009/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0009/expected.json index 2a92530d73..55989c03bf 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0009/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0009/expected.json @@ -68,11 +68,13 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "foo" }, "name": "foo", "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } }, "arguments": [] diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0010/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0010/expected.json index 937e364bb2..85def70954 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0010/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0010/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "milkyway" }, "name": "milkyway" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0011/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0011/expected.json index 9b9c988c91..9b29fb40a0 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0011/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0011/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "milkyway" }, "name": "milkyway" }, @@ -116,13 +118,15 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "solarsystem" }, "name": "solarsystem" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0012/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0012/expected.json index e160672e6a..3a03cde9b1 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0012/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0012/expected.json @@ -96,7 +96,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -112,7 +113,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "milkyway" }, "name": "milkyway" }, @@ -130,7 +132,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "solarsystem" }, "name": "solarsystem" }, @@ -148,13 +151,15 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "Earth" }, "name": "Earth" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0013/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0013/expected.json index 269aad8658..fcc39e4ecc 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0013/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0013/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "galaxyName" }, "name": "galaxyName" }, @@ -115,7 +117,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "otherUselessName" }, "name": "otherUselessName" } @@ -124,6 +127,7 @@ "computed": true } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0014/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0014/expected.json index fd2ad08336..6a6c95e194 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0014/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0014/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "galaxyName" }, "name": "galaxyName" }, "computed": true } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0015/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0015/expected.json index ff93859240..7dbf01ef02 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0015/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0015/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "galaxies" }, "name": "galaxies" }, diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0016/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0016/expected.json index a12ebbfc91..a732436290 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0016/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0016/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -121,7 +122,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "galaxies" }, "name": "galaxies" }, diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0017/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0017/expected.json index a8ceaa9228..fa67fb5375 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0017/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0017/expected.json @@ -110,7 +110,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -149,7 +150,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "galaxies" }, "name": "galaxies" }, @@ -230,7 +232,8 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "milkyway" }, "name": "milkyway" }, diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0018/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0018/expected.json index 0286b0ea65..edbf36b172 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0018/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0018/expected.json @@ -110,7 +110,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "earth" }, "name": "earth" }, @@ -126,7 +127,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "asia" }, "name": "asia" }, @@ -144,7 +146,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "Indonesia" }, "name": "Indonesia" }, @@ -162,7 +165,8 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "prepareForElection" }, "name": "prepareForElection" }, diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0019/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0019/expected.json index 41129f5624..92b467b8e9 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0019/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0019/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "if" }, "name": "if" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0020/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0020/expected.json index b31bc7542a..43038cf090 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0020/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0020/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "true" }, "name": "true" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0021/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0021/expected.json index 5bc538a2b9..76fd57dc7a 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0021/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0021/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "false" }, "name": "false" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-left-hand-side/migrated_0022/expected.json b/test/fixtures/esprima/expression-left-hand-side/migrated_0022/expected.json index a8f3caddc1..1e0fe82f7b 100644 --- a/test/fixtures/esprima/expression-left-hand-side/migrated_0022/expected.json +++ b/test/fixtures/esprima/expression-left-hand-side/migrated_0022/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "universe" }, "name": "universe" }, @@ -84,13 +85,15 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "null" }, "name": "null" }, "computed": false } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-multiplicative/migrated_0000/expected.json b/test/fixtures/esprima/expression-multiplicative/migrated_0000/expected.json index 89022ede9f..e4544003c4 100644 --- a/test/fixtures/esprima/expression-multiplicative/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0000/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-multiplicative/migrated_0001/expected.json b/test/fixtures/esprima/expression-multiplicative/migrated_0001/expected.json index 8a860dd890..328a727dec 100644 --- a/test/fixtures/esprima/expression-multiplicative/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0001/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-multiplicative/migrated_0002/expected.json b/test/fixtures/esprima/expression-multiplicative/migrated_0002/expected.json index 2887a84d0e..ee2eb7b83f 100644 --- a/test/fixtures/esprima/expression-multiplicative/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-multiplicative/migrated_0002/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0000/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0000/expected.json index 0712715b16..6cff980e29 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0000/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0001/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0001/expected.json index c4ea608985..b402ef1d3f 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0001/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0002/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0002/expected.json index b1909f3acc..4436502a54 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0002/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "eval" }, "name": "eval" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0003/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0003/expected.json index aaebc648e7..28309341ef 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0003/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "eval" }, "name": "eval" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0004/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0004/expected.json index bb07286fc5..397833c9f4 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0004/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "arguments" }, "name": "arguments" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-postfix/migrated_0005/expected.json b/test/fixtures/esprima/expression-postfix/migrated_0005/expected.json index 5fdbf545d2..b27829eedc 100644 --- a/test/fixtures/esprima/expression-postfix/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-postfix/migrated_0005/expected.json @@ -70,12 +70,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "arguments" }, "name": "arguments" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/array/expected.json b/test/fixtures/esprima/expression-primary/array/expected.json index 10130f3578..1df1b8a0fb 100644 --- a/test/fixtures/esprima/expression-primary/array/expected.json +++ b/test/fixtures/esprima/expression-primary/array/expected.json @@ -27,6 +27,7 @@ } }, "sourceType": "script", - "body": [] + "body": [], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/literal/expected.json b/test/fixtures/esprima/expression-primary/literal/expected.json index 10130f3578..1df1b8a0fb 100644 --- a/test/fixtures/esprima/expression-primary/literal/expected.json +++ b/test/fixtures/esprima/expression-primary/literal/expected.json @@ -27,6 +27,7 @@ } }, "sourceType": "script", - "body": [] + "body": [], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/object/expected.json b/test/fixtures/esprima/expression-primary/object/expected.json index 10130f3578..1df1b8a0fb 100644 --- a/test/fixtures/esprima/expression-primary/object/expected.json +++ b/test/fixtures/esprima/expression-primary/object/expected.json @@ -27,6 +27,7 @@ } }, "sourceType": "script", - "body": [] + "body": [], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-primary/other/expected.json b/test/fixtures/esprima/expression-primary/other/expected.json index 10130f3578..1df1b8a0fb 100644 --- a/test/fixtures/esprima/expression-primary/other/expected.json +++ b/test/fixtures/esprima/expression-primary/other/expected.json @@ -27,6 +27,7 @@ } }, "sourceType": "script", - "body": [] + "body": [], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0000/expected.json b/test/fixtures/esprima/expression-relational/migrated_0000/expected.json index da2300c3ba..39ed4b1c81 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0000/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0001/expected.json b/test/fixtures/esprima/expression-relational/migrated_0001/expected.json index d036898e8d..edbe85495e 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0001/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0002/expected.json b/test/fixtures/esprima/expression-relational/migrated_0002/expected.json index 21272df967..f4fd2421d9 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0002/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0003/expected.json b/test/fixtures/esprima/expression-relational/migrated_0003/expected.json index 4eba25fa96..fab9884151 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0003/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0004/expected.json b/test/fixtures/esprima/expression-relational/migrated_0004/expected.json index 179ec5032f..09804a0b7c 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0004/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0005/expected.json b/test/fixtures/esprima/expression-relational/migrated_0005/expected.json index 8edd71168c..992fb876e2 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0005/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-relational/migrated_0006/expected.json b/test/fixtures/esprima/expression-relational/migrated_0006/expected.json index 855baa45d7..39e74f7d29 100644 --- a/test/fixtures/esprima/expression-relational/migrated_0006/expected.json +++ b/test/fixtures/esprima/expression-relational/migrated_0006/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "y" }, "name": "y" } @@ -117,12 +119,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "z" }, "name": "z" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0000/expected.json b/test/fixtures/esprima/expression-unary/migrated_0000/expected.json index b8e60e420d..a072a29131 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0000/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0000/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0001/expected.json b/test/fixtures/esprima/expression-unary/migrated_0001/expected.json index 74d0f506ec..29f62109f3 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0001/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0001/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0002/expected.json b/test/fixtures/esprima/expression-unary/migrated_0002/expected.json index 892974799e..164c7de5e1 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0002/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0002/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "eval" }, "name": "eval" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0003/expected.json b/test/fixtures/esprima/expression-unary/migrated_0003/expected.json index f82908bc2b..e24ebd8ae3 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0003/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0003/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "eval" }, "name": "eval" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0004/expected.json b/test/fixtures/esprima/expression-unary/migrated_0004/expected.json index e190c488dd..f8c24a6e5c 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0004/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0004/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "arguments" }, "name": "arguments" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0005/expected.json b/test/fixtures/esprima/expression-unary/migrated_0005/expected.json index 8451361753..7c9d3dd0a4 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0005/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0005/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "arguments" }, "name": "arguments" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0006/expected.json b/test/fixtures/esprima/expression-unary/migrated_0006/expected.json index 62ee624c4c..8c0aefbb8e 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0006/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0006/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0007/expected.json b/test/fixtures/esprima/expression-unary/migrated_0007/expected.json index 4b614da625..d0695f2e20 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0007/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0007/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0008/expected.json b/test/fixtures/esprima/expression-unary/migrated_0008/expected.json index 326a3d6c51..900b160cf8 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0008/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0008/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0009/expected.json b/test/fixtures/esprima/expression-unary/migrated_0009/expected.json index 5db05c771f..47e35ce89d 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0009/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0009/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 2 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0010/expected.json b/test/fixtures/esprima/expression-unary/migrated_0010/expected.json index 776ed71df2..9c3d31a745 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0010/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0010/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0011/expected.json b/test/fixtures/esprima/expression-unary/migrated_0011/expected.json index f5edc45759..87f98df461 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0011/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0011/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/expression-unary/migrated_0012/expected.json b/test/fixtures/esprima/expression-unary/migrated_0012/expected.json index 137dc642bc..644e2e6689 100644 --- a/test/fixtures/esprima/expression-unary/migrated_0012/expected.json +++ b/test/fixtures/esprima/expression-unary/migrated_0012/expected.json @@ -70,12 +70,17 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "parenthesizedArgument": false } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json b/test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json deleted file mode 100644 index 0d183a7bf6..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ExpressionStatement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "expression": { - "type": "Literal", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "value": "9", - "rawValue": "9", - "raw": "\"\\9\"" - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0033/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0033/expected.json deleted file mode 100644 index f4fe7d7ce4..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0033/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "value": "x\\u005c", - "rawValue": "x\\u005c", - "raw": "'x\\\\u005c'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0034/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0034/expected.json deleted file mode 100644 index bc71c475ce..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0034/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "value": "x\\u002a", - "rawValue": "x\\u002a", - "raw": "'x\\\\u002a'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0035/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0035/expected.json deleted file mode 100644 index 798f613862..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0035/expected.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "name": "x" - }, - "init": { - "type": "Literal", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "raw": "/(s/g", - "regex": { - "pattern": "(s", - "flags": "g" - } - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0036/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0036/expected.json deleted file mode 100644 index ee388c0ff8..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0036/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "value": "a\\u", - "rawValue": "a\\u", - "raw": "'a\\\\u'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0037/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0037/expected.json deleted file mode 100644 index 1e4947ba6c..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0037/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "value": "\\ua", - "rawValue": "\\ua", - "raw": "'\\\\ua'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0041/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0041/expected.json deleted file mode 100644 index 432370bc2e..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0041/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 35 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 34 - } - }, - "value": "var x = /[a-z]/\\ux", - "rawValue": "var x = /[a-z]/\\ux", - "raw": "'var x = /[a-z]/\\\\ux'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0042/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0042/expected.json deleted file mode 100644 index 88d96a096a..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0042/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "value": "var x = /[a-z\n]/\\ux", - "rawValue": "var x = /[a-z\n]/\\ux", - "raw": "'var x = /[a-z\\n]/\\\\ux'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0043/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0043/expected.json deleted file mode 100644 index 5dccf2df66..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0043/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "value": "var x = /[a-z]/\\\\ux", - "rawValue": "var x = /[a-z]/\\\\ux", - "raw": "'var x = /[a-z]/\\\\\\\\ux'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0044/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0044/expected.json deleted file mode 100644 index 7b451084c4..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0044/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 41 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 40 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 40 - } - }, - "value": "var x = /[P QR]/\\\\u0067", - "rawValue": "var x = /[P QR]/\\\\u0067", - "raw": "'var x = /[P QR]/\\\\\\\\u0067'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0048/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0048/expected.json deleted file mode 100644 index c74b8f4b9d..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0048/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "value": "\"\\u{110000}\"", - "rawValue": "\"\\u{110000}\"", - "raw": "'\"\\\\u{110000}\"'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0049/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0049/expected.json deleted file mode 100644 index 0d8aed2410..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0049/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "value": "\"\\u{}\"", - "rawValue": "\"\\u{}\"", - "raw": "'\"\\\\u{}\"'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0050/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0050/expected.json deleted file mode 100644 index fc597b32c5..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0050/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "value": "\"\\u{FFFF\"", - "rawValue": "\"\\u{FFFF\"", - "raw": "'\"\\\\u{FFFF\"'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0051/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0051/expected.json deleted file mode 100644 index e22bc63888..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0051/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "value": "\"\\u{FFZ}\"", - "rawValue": "\"\\u{FFZ}\"", - "raw": "'\"\\\\u{FFZ}\"'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0137/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0137/expected.json deleted file mode 100644 index c910512d1a..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0137/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "value": "‿ = 10", - "rawValue": "‿ = 10", - "raw": "'\\u203F = 10'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0163/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0163/expected.json deleted file mode 100644 index e3f4ea1270..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0163/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "value": "\\u005c", - "rawValue": "\\u005c", - "raw": "'\\\\u005c'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0165/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0165/expected.json deleted file mode 100644 index 968d4f6a66..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0165/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "value": "\\u0000", - "rawValue": "\\u0000", - "raw": "'\\\\u0000'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0166/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0166/expected.json deleted file mode 100644 index f9b68dd718..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0166/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "value": "‌ = []", - "rawValue": "‌ = []", - "raw": "'\\u200C = []'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0167/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0167/expected.json deleted file mode 100644 index 238759889e..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0167/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "value": "‍ = []", - "rawValue": "‍ = []", - "raw": "'\\u200D = []'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0169/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0169/expected.json deleted file mode 100644 index 5dcccc5d34..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0169/expected.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "sourceType": "script", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 20 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "source" - }, - "init": { - "type": "Literal", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "value": "\"\\u", - "rawValue": "\"\\u", - "raw": "'\"\\\\u'" - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/.migrated_0277/expected.json b/test/fixtures/esprima/invalid-syntax/.migrated_0277/expected.json deleted file mode 100644 index 374479f48a..0000000000 --- a/test/fixtures/esprima/invalid-syntax/.migrated_0277/expected.json +++ /dev/null @@ -1,168 +0,0 @@ -{ - "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": "script", - "body": [ - { - "type": "ClassDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "id": { - "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "name": "A" - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 8, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 19 - } - }, - "body": [ - { - "type": "ClassMethod", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "computed": false, - "key": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "a" - }, - "static": false, - "kind": "method", - "value": { - "type": "FunctionExpression", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "id": null, - "generator": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "name": "enum" - } - ], - "body": { - "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "body": [] - } - } - } - ] - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-block/migrated_0000/expected.json b/test/fixtures/esprima/statement-block/migrated_0000/expected.json index 5d5053da91..ca5a5fb0eb 100644 --- a/test/fixtures/esprima/statement-block/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-block/migrated_0000/expected.json @@ -69,13 +69,16 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "foo" }, "name": "foo" } } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-block/migrated_0001/expected.json b/test/fixtures/esprima/statement-block/migrated_0001/expected.json index eec6775871..b271f0a04c 100644 --- a/test/fixtures/esprima/statement-block/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-block/migrated_0001/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "doThis" }, "name": "doThis" }, @@ -130,15 +131,18 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "doThat" }, "name": "doThat" }, "arguments": [] } } - ] + ], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-block/migrated_0002/expected.json b/test/fixtures/esprima/statement-block/migrated_0002/expected.json index 5792211240..d209b58703 100644 --- a/test/fixtures/esprima/statement-block/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-block/migrated_0002/expected.json @@ -42,8 +42,10 @@ "column": 2 } }, - "body": [] + "body": [], + "directives": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-break/migrated_0001/expected.json b/test/fixtures/esprima/statement-break/migrated_0001/expected.json index 930203bdfe..b46b8cecc6 100644 --- a/test/fixtures/esprima/statement-break/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-break/migrated_0001/expected.json @@ -113,7 +113,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "done" }, "name": "done" } @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "done" }, "name": "done" } diff --git a/test/fixtures/esprima/statement-break/migrated_0002/expected.json b/test/fixtures/esprima/statement-break/migrated_0002/expected.json index 207d4cf4c5..75ce4af774 100644 --- a/test/fixtures/esprima/statement-break/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-break/migrated_0002/expected.json @@ -113,7 +113,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "done" }, "name": "done" } @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "done" }, "name": "done" } diff --git a/test/fixtures/esprima/statement-break/migrated_0003/expected.json b/test/fixtures/esprima/statement-break/migrated_0003/expected.json index 694def79b2..91efaf586f 100644 --- a/test/fixtures/esprima/statement-break/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-break/migrated_0003/expected.json @@ -113,7 +113,8 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" } @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" } diff --git a/test/fixtures/esprima/statement-continue/migrated_0002/expected.json b/test/fixtures/esprima/statement-continue/migrated_0002/expected.json index 3d3611769c..7b69d3e398 100644 --- a/test/fixtures/esprima/statement-continue/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-continue/migrated_0002/expected.json @@ -113,7 +113,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "done" }, "name": "done" } @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "done" }, "name": "done" } diff --git a/test/fixtures/esprima/statement-continue/migrated_0003/expected.json b/test/fixtures/esprima/statement-continue/migrated_0003/expected.json index e2eede95cf..73a3847e0b 100644 --- a/test/fixtures/esprima/statement-continue/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-continue/migrated_0003/expected.json @@ -113,7 +113,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "done" }, "name": "done" } @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "done" }, "name": "done" } diff --git a/test/fixtures/esprima/statement-continue/migrated_0004/expected.json b/test/fixtures/esprima/statement-continue/migrated_0004/expected.json index 076d4478b5..3c78b5f5bc 100644 --- a/test/fixtures/esprima/statement-continue/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-continue/migrated_0004/expected.json @@ -113,7 +113,8 @@ "end": { "line": 1, "column": 44 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" } @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" } diff --git a/test/fixtures/esprima/statement-debugger/migrated_0000/expected.json b/test/fixtures/esprima/statement-debugger/migrated_0000/expected.json index bf36100cfe..c70dc07eb5 100644 --- a/test/fixtures/esprima/statement-debugger/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-debugger/migrated_0000/expected.json @@ -43,6 +43,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-empty/migrated_0000/expected.json b/test/fixtures/esprima/statement-empty/migrated_0000/expected.json index d76894f1aa..e48902c158 100644 --- a/test/fixtures/esprima/statement-empty/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-empty/migrated_0000/expected.json @@ -43,6 +43,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-expression/migrated_0000/expected.json b/test/fixtures/esprima/statement-expression/migrated_0000/expected.json index 470ad995ab..7d660bdda7 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0000/expected.json @@ -54,11 +54,13 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-expression/migrated_0001/expected.json b/test/fixtures/esprima/statement-expression/migrated_0001/expected.json index a1f0e67018..a8a40d3c2b 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0001/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,13 +86,15 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "y" }, "name": "y" } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-expression/migrated_0002/expected.json b/test/fixtures/esprima/statement-expression/migrated_0002/expected.json index 03f4a58cb3..96f353ac3f 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0002/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "source" }, "name": "source" }, diff --git a/test/fixtures/esprima/statement-expression/migrated_0003/expected.json b/test/fixtures/esprima/statement-expression/migrated_0003/expected.json index d292e2317d..367ca3f2a4 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0003/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "source" }, "name": "source" }, diff --git a/test/fixtures/esprima/statement-expression/migrated_0004/expected.json b/test/fixtures/esprima/statement-expression/migrated_0004/expected.json index 58b1ca21f8..598c8c3a94 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0004/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "source" }, "name": "source" }, diff --git a/test/fixtures/esprima/statement-expression/migrated_0005/expected.json b/test/fixtures/esprima/statement-expression/migrated_0005/expected.json index b9ab7766f2..d368ff1a7f 100644 --- a/test/fixtures/esprima/statement-expression/migrated_0005/expected.json +++ b/test/fixtures/esprima/statement-expression/migrated_0005/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "source" }, "name": "source" }, diff --git a/test/fixtures/esprima/statement-if/migrated_0000/expected.json b/test/fixtures/esprima/statement-if/migrated_0000/expected.json index 61f0887961..18f37a7b65 100644 --- a/test/fixtures/esprima/statement-if/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0000/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "morning" }, "name": "morning" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "goodMorning" }, "name": "goodMorning" }, @@ -107,6 +109,7 @@ }, "alternate": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-if/migrated_0001/expected.json b/test/fixtures/esprima/statement-if/migrated_0001/expected.json index 640c5691c2..38198e3d25 100644 --- a/test/fixtures/esprima/statement-if/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0001/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "morning" }, "name": "morning" }, @@ -89,6 +90,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -108,7 +110,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 13 } } }, diff --git a/test/fixtures/esprima/statement-if/migrated_0002/expected.json b/test/fixtures/esprima/statement-if/migrated_0002/expected.json index bf2044c42a..492f0ac62c 100644 --- a/test/fixtures/esprima/statement-if/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0002/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "morning" }, "name": "morning" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/statement-if/migrated_0004/expected.json b/test/fixtures/esprima/statement-if/migrated_0004/expected.json index 720f53798d..453c4e700d 100644 --- a/test/fixtures/esprima/statement-if/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0004/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "morning" }, "name": "morning" }, @@ -98,7 +99,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "goodMorning" }, "name": "goodMorning" }, @@ -145,7 +147,8 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "goodDay" }, "name": "goodDay" }, @@ -153,6 +156,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-if/migrated_0005/expected.json b/test/fixtures/esprima/statement-if/migrated_0005/expected.json index baa36356a5..efb3af5fec 100644 --- a/test/fixtures/esprima/statement-if/migrated_0005/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0005/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "that" }, "name": "that" }, diff --git a/test/fixtures/esprima/statement-if/migrated_0006/expected.json b/test/fixtures/esprima/statement-if/migrated_0006/expected.json index 2f9b5c6964..0cfad45c37 100644 --- a/test/fixtures/esprima/statement-if/migrated_0006/expected.json +++ b/test/fixtures/esprima/statement-if/migrated_0006/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "that" }, "name": "that" }, diff --git a/test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json b/test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json deleted file mode 100644 index 20d1b7032f..0000000000 --- a/test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "sourceType": "script", - "body": [ - { - "type": "ForInStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "left": { - "type": "VariableDeclaration", - "start": 5, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "x" - }, - "init": { - "type": "AssignmentExpression", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } - }, - "name": "y" - }, - "right": { - "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "z" - } - } - } - ], - "kind": "var" - }, - "right": { - "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "name": "q" - }, - "body": { - "type": "EmptyStatement", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/const_forin/expected.json b/test/fixtures/esprima/statement-iteration/const_forin/expected.json index 24f754ab5a..aea7786f71 100644 --- a/test/fixtures/esprima/statement-iteration/const_forin/expected.json +++ b/test/fixtures/esprima/statement-iteration/const_forin/expected.json @@ -42,6 +42,7 @@ "column": 33 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -148,7 +151,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -165,7 +169,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "x" }, "name": "x" } @@ -173,6 +178,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/for-statement-with-seq/expected.json b/test/fixtures/esprima/statement-iteration/for-statement-with-seq/expected.json index caaf4a9a96..da4f943e81 100644 --- a/test/fixtures/esprima/statement-iteration/for-statement-with-seq/expected.json +++ b/test/fixtures/esprima/statement-iteration/for-statement-with-seq/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -101,7 +103,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "c" }, "name": "c" } @@ -125,6 +128,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0000/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0000/expected.json index 52f64a4d6b..6b99345c09 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0000/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "keep" }, "name": "keep" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0001/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0001/expected.json index 04998adb58..a131703fce 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0001/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "keep" }, "name": "keep" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0002/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0002/expected.json index 9814bc6039..e2f50113d3 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0002/expected.json @@ -99,7 +99,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" } @@ -147,7 +148,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "y" }, "name": "y" } @@ -182,7 +184,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json index 746642c0a5..b8d3fb1e01 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0004/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "that" }, "name": "that" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0005/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0005/expected.json index 5019d62edd..a618237dc9 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0005/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0005/expected.json @@ -82,7 +82,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "that" }, "name": "that" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0006/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0006/expected.json index b154f386f7..1cd371f080 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0006/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0006/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "doSomething" }, "name": "doSomething" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0007/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0007/expected.json index 8ca1322823..f08d3a9485 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0007/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0007/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -151,7 +152,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "x" }, "name": "x" } @@ -199,7 +201,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/esprima/statement-iteration/migrated_0008/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0008/expected.json index 9474ed02f5..5f4998d8a0 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0008/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0008/expected.json @@ -61,6 +61,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0009/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0009/expected.json index ee4511c5df..67a281d20e 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0009/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0009/expected.json @@ -59,9 +59,11 @@ "column": 9 } }, - "body": [] + "body": [], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0010/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0010/expected.json index 96e6163073..ac885ace49 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0010/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0010/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0011/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0011/expected.json index 06e23e5726..424fedd8b8 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0011/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0011/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0012/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0012/expected.json index ced9b7da30..a1ccc73433 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0012/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0012/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0013/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0013/expected.json index 9703da41dc..f701a8cc20 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0013/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0013/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "y" }, "name": "y" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0014/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0014/expected.json index 799bca6bd8..019c93da93 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0014/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0014/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0015/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0015/expected.json index bab630bd14..d44ae9616d 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0015/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0015/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -174,7 +176,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "x" }, "name": "x" } diff --git a/test/fixtures/esprima/statement-iteration/migrated_0016/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0016/expected.json index 88e0fa1c9f..bd932cf468 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0016/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0016/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -174,7 +176,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "x" }, "name": "x" } @@ -219,7 +222,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -236,7 +240,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "x" }, "name": "x" } diff --git a/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json index f95b2f15a7..9c7cdebe0f 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0017/expected.json @@ -42,6 +42,7 @@ "column": 26 } }, + "await": false, "left": { "type": "Identifier", "start": 4, @@ -54,7 +55,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -70,7 +72,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -114,7 +117,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -131,7 +135,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "x" }, "name": "x" } @@ -139,6 +144,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json index 50d29b5d32..4a3a0ecfda 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0018/expected.json @@ -42,6 +42,7 @@ "column": 31 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -148,7 +151,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -165,7 +169,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "x" }, "name": "x" } @@ -173,6 +178,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json index 12d30b3dd3..c86ced2dd6 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0020/expected.json @@ -42,6 +42,7 @@ "column": 31 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -83,7 +84,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "list" }, "name": "list" }, @@ -148,7 +151,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "process" }, "name": "process" }, @@ -165,7 +169,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "x" }, "name": "x" } @@ -173,6 +178,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json index 5eba72f1c0..9bb6c3e3fc 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0024/expected.json @@ -42,6 +42,7 @@ "column": 21 } }, + "await": false, "left": { "type": "MemberExpression", "start": 5, @@ -68,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -98,7 +100,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -115,7 +118,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "c" }, "name": "c" } @@ -134,7 +138,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "d" }, "name": "d" }, @@ -154,6 +159,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json index c0f69f2729..a50e44182a 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0025/expected.json @@ -42,6 +42,7 @@ "column": 24 } }, + "await": false, "left": { "type": "MemberExpression", "start": 5, @@ -82,7 +83,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -113,7 +115,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -130,7 +133,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "c" }, "name": "c" } @@ -171,7 +175,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "d" }, "name": "d" }, diff --git a/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json b/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json index df5bd2f21b..dc3c4e3104 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0026/expected.json @@ -42,6 +42,7 @@ "column": 16 } }, + "await": false, "left": { "type": "MemberExpression", "start": 5, @@ -68,7 +69,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -84,7 +86,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "in" }, "name": "in" }, @@ -102,7 +105,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -122,6 +126,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json b/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json index ea2201a00e..0edfa7e1e6 100644 --- a/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-labelled/migrated_0000/expected.json @@ -85,7 +85,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "start" }, "name": "start" } @@ -103,11 +104,13 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "start" }, "name": "start" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-labelled/migrated_0001/expected.json b/test/fixtures/esprima/statement-labelled/migrated_0001/expected.json index 5157602658..0c49d0e8f9 100644 --- a/test/fixtures/esprima/statement-labelled/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-labelled/migrated_0001/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "start" }, "name": "start" } @@ -116,7 +117,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "start" }, "name": "start" } diff --git a/test/fixtures/esprima/statement-labelled/migrated_0002/expected.json b/test/fixtures/esprima/statement-labelled/migrated_0002/expected.json index c1996f9d1b..7f81100ffa 100644 --- a/test/fixtures/esprima/statement-labelled/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-labelled/migrated_0002/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "test" }, "name": "test" } @@ -85,11 +86,13 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "__proto__" }, "name": "__proto__" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-return/migrated_0000/expected.json b/test/fixtures/esprima/statement-return/migrated_0000/expected.json index 3811851cf2..fe9666a99e 100644 --- a/test/fixtures/esprima/statement-return/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-return/migrated_0000/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -95,7 +96,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/statement-return/migrated_0001/expected.json b/test/fixtures/esprima/statement-return/migrated_0001/expected.json index cfc30f8e34..1f4ff8a16a 100644 --- a/test/fixtures/esprima/statement-return/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-return/migrated_0001/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -95,7 +96,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/statement-return/migrated_0002/expected.json b/test/fixtures/esprima/statement-return/migrated_0002/expected.json index 7e253235fc..05b71f8cff 100644 --- a/test/fixtures/esprima/statement-return/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-return/migrated_0002/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -101,7 +102,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "x" }, "name": "x" } @@ -110,7 +112,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/statement-return/migrated_0003/expected.json b/test/fixtures/esprima/statement-return/migrated_0003/expected.json index d4f71c39ad..bd73928291 100644 --- a/test/fixtures/esprima/statement-return/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-return/migrated_0003/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -132,7 +134,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "y" }, "name": "y" } @@ -142,7 +145,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/esprima/statement-switch/migrated_0000/expected.json b/test/fixtures/esprima/statement-switch/migrated_0000/expected.json index e48fd0f035..b77f94e94a 100644 --- a/test/fixtures/esprima/statement-switch/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-switch/migrated_0000/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" }, "cases": [] } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-switch/migrated_0001/expected.json b/test/fixtures/esprima/statement-switch/migrated_0001/expected.json index 54b7c12792..3c3a42b257 100644 --- a/test/fixtures/esprima/statement-switch/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-switch/migrated_0001/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "answer" }, "name": "answer" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "hi" }, "name": "hi" }, diff --git a/test/fixtures/esprima/statement-switch/migrated_0002/expected.json b/test/fixtures/esprima/statement-switch/migrated_0002/expected.json index ce967090f0..f474c77e7d 100644 --- a/test/fixtures/esprima/statement-switch/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-switch/migrated_0002/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "answer" }, "name": "answer" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "hi" }, "name": "hi" }, diff --git a/test/fixtures/esprima/statement-throw/migrated_0000/expected.json b/test/fixtures/esprima/statement-throw/migrated_0000/expected.json index 0e9f3c0da0..a5a7fc11ac 100644 --- a/test/fixtures/esprima/statement-throw/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-throw/migrated_0000/expected.json @@ -54,11 +54,13 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-throw/migrated_0001/expected.json b/test/fixtures/esprima/statement-throw/migrated_0001/expected.json index 91f3d0ffa7..fbc9ab8952 100644 --- a/test/fixtures/esprima/statement-throw/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-throw/migrated_0001/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -85,12 +86,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "y" }, "name": "y" } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-throw/migrated_0002/expected.json b/test/fixtures/esprima/statement-throw/migrated_0002/expected.json index 1586888a8b..e0ef904785 100644 --- a/test/fixtures/esprima/statement-throw/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-throw/migrated_0002/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "message" }, "name": "message" }, diff --git a/test/fixtures/esprima/statement-try/migrated_0000/expected.json b/test/fixtures/esprima/statement-try/migrated_0000/expected.json index 49a3324324..e5753c7cc2 100644 --- a/test/fixtures/esprima/statement-try/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0000/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -102,12 +104,14 @@ "column": 21 } }, - "body": [] + "body": [], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0001/expected.json b/test/fixtures/esprima/statement-try/migrated_0001/expected.json index 4fa8f999b5..7a8e08f5e0 100644 --- a/test/fixtures/esprima/statement-try/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0001/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "eval" }, "name": "eval" }, @@ -102,12 +104,14 @@ "column": 24 } }, - "body": [] + "body": [], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0002/expected.json b/test/fixtures/esprima/statement-try/migrated_0002/expected.json index 42cc2e8bf7..a6eb4ec45b 100644 --- a/test/fixtures/esprima/statement-try/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0002/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, @@ -102,12 +104,14 @@ "column": 29 } }, - "body": [] + "body": [], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0003/expected.json b/test/fixtures/esprima/statement-try/migrated_0003/expected.json index bb353db32f..2e17e596c6 100644 --- a/test/fixtures/esprima/statement-try/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0003/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": { "type": "CatchClause", @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -143,7 +145,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "say" }, "name": "say" }, @@ -160,19 +163,22 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "e" }, "name": "e" } ] } } - ] + ], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0004/expected.json b/test/fixtures/esprima/statement-try/migrated_0004/expected.json index ca8f6bd080..4f92072de7 100644 --- a/test/fixtures/esprima/statement-try/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0004/expected.json @@ -56,7 +56,8 @@ "column": 7 } }, - "body": [] + "body": [], + "directives": [] }, "handler": null, "guardedHandlers": [], @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "cleanup" }, "name": "cleanup" }, @@ -132,16 +134,19 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "stuff" }, "name": "stuff" } ] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0005/expected.json b/test/fixtures/esprima/statement-try/migrated_0005/expected.json index 291705c18b..6024793dbd 100644 --- a/test/fixtures/esprima/statement-try/migrated_0005/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0005/expected.json @@ -97,14 +97,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "doThat" }, "name": "doThat" }, "arguments": [] } } - ] + ], + "directives": [] }, "handler": { "type": "CatchClause", @@ -132,7 +134,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -191,7 +194,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "say" }, "name": "say" }, @@ -208,19 +212,22 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "e" }, "name": "e" } ] } } - ] + ], + "directives": [] } }, "guardedHandlers": [], "finalizer": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-try/migrated_0006/expected.json b/test/fixtures/esprima/statement-try/migrated_0006/expected.json index 9dd799f3ee..c73f720c72 100644 --- a/test/fixtures/esprima/statement-try/migrated_0006/expected.json +++ b/test/fixtures/esprima/statement-try/migrated_0006/expected.json @@ -97,14 +97,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "doThat" }, "name": "doThat" }, "arguments": [] } } - ] + ], + "directives": [] }, "handler": { "type": "CatchClause", @@ -132,7 +134,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "e" }, "name": "e" }, @@ -191,7 +194,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "say" }, "name": "say" }, @@ -208,14 +212,16 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "e" }, "name": "e" } ] } } - ] + ], + "directives": [] } }, "guardedHandlers": [], @@ -274,7 +280,8 @@ "end": { "line": 1, "column": 56 - } + }, + "identifierName": "cleanup" }, "name": "cleanup" }, @@ -291,16 +298,19 @@ "end": { "line": 1, "column": 62 - } + }, + "identifierName": "stuff" }, "name": "stuff" } ] } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0000/expected.json b/test/fixtures/esprima/statement-variable/migrated_0000/expected.json index ec2dadfcf0..2dc156600a 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0000/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -78,6 +79,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0001/expected.json b/test/fixtures/esprima/statement-variable/migrated_0001/expected.json index 4ed5077fe0..efb47e7394 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0001/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -101,7 +102,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -110,6 +112,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0002/expected.json b/test/fixtures/esprima/statement-variable/migrated_0002/expected.json index fceb7088d9..8515e2fd31 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0002/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/esprima/statement-variable/migrated_0003/expected.json b/test/fixtures/esprima/statement-variable/migrated_0003/expected.json index 0937c1b68d..c43470cfea 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0003/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0003/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "eval" }, "name": "eval" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "arguments" }, "name": "arguments" }, diff --git a/test/fixtures/esprima/statement-variable/migrated_0004/expected.json b/test/fixtures/esprima/statement-variable/migrated_0004/expected.json index 4c14f501ea..880833c662 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0004/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0004/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -171,7 +173,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "z" }, "name": "z" }, diff --git a/test/fixtures/esprima/statement-variable/migrated_0005/expected.json b/test/fixtures/esprima/statement-variable/migrated_0005/expected.json index 17a5559327..3b4811d947 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0005/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0005/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "implements" }, "name": "implements" }, @@ -101,7 +102,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "interface" }, "name": "interface" }, @@ -133,7 +135,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "package" }, "name": "package" }, @@ -142,6 +145,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-variable/migrated_0006/expected.json b/test/fixtures/esprima/statement-variable/migrated_0006/expected.json index 8744560249..1afee34c9e 100644 --- a/test/fixtures/esprima/statement-variable/migrated_0006/expected.json +++ b/test/fixtures/esprima/statement-variable/migrated_0006/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "private" }, "name": "private" }, @@ -101,7 +102,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "protected" }, "name": "protected" }, @@ -133,7 +135,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "public" }, "name": "public" }, @@ -165,7 +168,8 @@ "end": { "line": 1, "column": 38 - } + }, + "identifierName": "static" }, "name": "static" }, @@ -174,6 +178,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-with/migrated_0000/expected.json b/test/fixtures/esprima/statement-with/migrated_0000/expected.json index f4e3da9d15..c1ca938f16 100644 --- a/test/fixtures/esprima/statement-with/migrated_0000/expected.json +++ b/test/fixtures/esprima/statement-with/migrated_0000/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -115,13 +117,15 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "bar" }, "name": "bar" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-with/migrated_0001/expected.json b/test/fixtures/esprima/statement-with/migrated_0001/expected.json index 9e895a7f45..bca8b9d7da 100644 --- a/test/fixtures/esprima/statement-with/migrated_0001/expected.json +++ b/test/fixtures/esprima/statement-with/migrated_0001/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -115,13 +117,15 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "bar" }, "name": "bar" } } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/esprima/statement-with/migrated_0002/expected.json b/test/fixtures/esprima/statement-with/migrated_0002/expected.json index d9e30cca90..e44e902aa7 100644 --- a/test/fixtures/esprima/statement-with/migrated_0002/expected.json +++ b/test/fixtures/esprima/statement-with/migrated_0002/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -130,15 +132,18 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "bar" }, "name": "bar" } } } - ] + ], + "directives": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/estree/class-method/basic/expected.json b/test/fixtures/estree/class-method/basic/expected.json index 87805524b4..8b70b14f6d 100644 --- a/test/fixtures/estree/class-method/basic/expected.json +++ b/test/fixtures/estree/class-method/basic/expected.json @@ -89,6 +89,7 @@ "column": 10 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -107,7 +108,6 @@ }, "name": "foo" }, - "static": false, "kind": "method", "value": { "type": "FunctionExpression", @@ -125,6 +125,7 @@ }, "id": null, "generator": false, + "expression": false, "async": false, "params": [], "body": { @@ -142,8 +143,7 @@ } }, "body": [] - }, - "expression": false + } } } ] @@ -151,4 +151,4 @@ } ] } -} +} \ No newline at end of file diff --git a/test/fixtures/estree/literal/boolean/expected.json b/test/fixtures/estree/literal/boolean/expected.json index 9cb28a78b5..0fb347fbd5 100644 --- a/test/fixtures/estree/literal/boolean/expected.json +++ b/test/fixtures/estree/literal/boolean/expected.json @@ -164,4 +164,4 @@ } ] } -} +} \ No newline at end of file diff --git a/test/fixtures/estree/literal/null/expected.json b/test/fixtures/estree/literal/null/expected.json index 3d8f657e41..f333081a50 100644 --- a/test/fixtures/estree/literal/null/expected.json +++ b/test/fixtures/estree/literal/null/expected.json @@ -97,4 +97,4 @@ } ] } -} +} \ No newline at end of file diff --git a/test/fixtures/estree/literal/number/expected.json b/test/fixtures/estree/literal/number/expected.json index 4a0f809cc1..f27bafff6e 100644 --- a/test/fixtures/estree/literal/number/expected.json +++ b/test/fixtures/estree/literal/number/expected.json @@ -97,4 +97,4 @@ } ] } -} +} \ No newline at end of file diff --git a/test/fixtures/estree/literal/regexp/expected.json b/test/fixtures/estree/literal/regexp/expected.json index 1cc7f34829..dd522b9e9c 100644 --- a/test/fixtures/estree/literal/regexp/expected.json +++ b/test/fixtures/estree/literal/regexp/expected.json @@ -101,4 +101,4 @@ } ] } -} +} \ No newline at end of file diff --git a/test/fixtures/estree/literal/string/expected.json b/test/fixtures/estree/literal/string/expected.json index eb0a80831e..5e91d5d539 100644 --- a/test/fixtures/estree/literal/string/expected.json +++ b/test/fixtures/estree/literal/string/expected.json @@ -97,4 +97,4 @@ } ] } -} +} \ No newline at end of file diff --git a/test/fixtures/estree/object-property/basic/expected.json b/test/fixtures/estree/object-property/basic/expected.json index 61a0aaeb62..650d82af47 100644 --- a/test/fixtures/estree/object-property/basic/expected.json +++ b/test/fixtures/estree/object-property/basic/expected.json @@ -150,4 +150,4 @@ } ] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/async-generators/class-method-2/expected.json b/test/fixtures/experimental/async-generators/class-method-2/expected.json index d0dfc49fa8..ea451fd3cb 100644 --- a/test/fixtures/experimental/async-generators/class-method-2/expected.json +++ b/test/fixtures/experimental/async-generators/class-method-2/expected.json @@ -90,7 +90,6 @@ } }, "static": false, - "kind": "method", "computed": false, "key": { "type": "Identifier", @@ -109,6 +108,7 @@ }, "name": "a" }, + "kind": "method", "id": null, "generator": true, "expression": false, diff --git a/test/fixtures/experimental/async-generators/class-method/expected.json b/test/fixtures/experimental/async-generators/class-method/expected.json index f1a8cb05c1..82b6bd579f 100644 --- a/test/fixtures/experimental/async-generators/class-method/expected.json +++ b/test/fixtures/experimental/async-generators/class-method/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "Query" }, "name": "Query" }, @@ -88,6 +89,7 @@ "column": 5 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 2, "column": 19 - } + }, + "identifierName": "queryAll" }, "name": "queryAll" }, - "static": false, "kind": "method", "id": null, "generator": true, @@ -124,7 +126,8 @@ "end": { "line": 2, "column": 23 - } + }, + "identifierName": "ids" }, "name": "ids" } @@ -158,6 +161,7 @@ "column": 9 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 54, @@ -199,7 +203,8 @@ "end": { "line": 3, "column": 21 - } + }, + "identifierName": "id" }, "name": "id" }, @@ -220,7 +225,8 @@ "end": { "line": 3, "column": 28 - } + }, + "identifierName": "ids" }, "name": "ids" }, @@ -337,7 +343,8 @@ "end": { "line": 4, "column": 34 - } + }, + "identifierName": "query" }, "name": "query" }, @@ -356,7 +363,8 @@ "end": { "line": 4, "column": 37 - } + }, + "identifierName": "id" }, "name": "id" } @@ -379,4 +387,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/async-generators/for-await/expected.json b/test/fixtures/experimental/async-generators/for-await/expected.json index 273efee728..b69586316e 100644 --- a/test/fixtures/experimental/async-generators/for-await/expected.json +++ b/test/fixtures/experimental/async-generators/for-await/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -133,7 +134,8 @@ "end": { "line": 2, "column": 18 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -154,7 +156,8 @@ "end": { "line": 2, "column": 23 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -181,4 +184,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/async-generators/object-method/expected.json b/test/fixtures/experimental/async-generators/object-method/expected.json index 5a25c2ce85..79413a2d47 100644 --- a/test/fixtures/experimental/async-generators/object-method/expected.json +++ b/test/fixtures/experimental/async-generators/object-method/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "query" }, "name": "query" }, @@ -117,7 +118,8 @@ "end": { "line": 2, "column": 19 - } + }, + "identifierName": "queryAll" }, "name": "queryAll" }, @@ -139,7 +141,8 @@ "end": { "line": 2, "column": 23 - } + }, + "identifierName": "ids" }, "name": "ids" } @@ -173,6 +176,7 @@ "column": 9 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 56, @@ -214,7 +218,8 @@ "end": { "line": 3, "column": 21 - } + }, + "identifierName": "id" }, "name": "id" }, @@ -235,7 +240,8 @@ "end": { "line": 3, "column": 28 - } + }, + "identifierName": "ids" }, "name": "ids" }, @@ -352,7 +358,8 @@ "end": { "line": 4, "column": 34 - } + }, + "identifierName": "query" }, "name": "query" }, @@ -371,7 +378,8 @@ "end": { "line": 4, "column": 37 - } + }, + "identifierName": "id" }, "name": "id" } @@ -397,4 +405,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/class-properties/asi-success/expected.json b/test/fixtures/experimental/class-properties/asi-success/expected.json index c78a521f9c..180c9fa44d 100644 --- a/test/fixtures/experimental/class-properties/asi-success/expected.json +++ b/test/fixtures/experimental/class-properties/asi-success/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 3 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 2, "column": 3 - } + }, + "identifierName": "x" }, "name": "x" }, - "static": false, "value": null }, { @@ -122,6 +124,7 @@ "column": 3 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -135,11 +138,11 @@ "end": { "line": 3, "column": 3 - } + }, + "identifierName": "y" }, "name": "y" }, - "static": false, "value": null } ] @@ -171,7 +174,8 @@ "end": { "line": 6, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -205,6 +209,7 @@ "column": 3 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -218,11 +223,11 @@ "end": { "line": 7, "column": 3 - } + }, + "identifierName": "p" }, "name": "p" }, - "static": false, "value": null }, { @@ -239,6 +244,7 @@ "column": 11 } }, + "static": false, "computed": true, "key": { "type": "Identifier", @@ -252,15 +258,16 @@ "end": { "line": 8, "column": 4 - } + }, + "identifierName": "m" }, "name": "m" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/experimental/class-properties/computed/expected.json b/test/fixtures/experimental/class-properties/computed/expected.json index 763fedb8d0..dcdd64b2d8 100644 --- a/test/fixtures/experimental/class-properties/computed/expected.json +++ b/test/fixtures/experimental/class-properties/computed/expected.json @@ -89,6 +89,7 @@ "column": 5 } }, + "static": false, "computed": true, "key": { "type": "Identifier", @@ -107,7 +108,6 @@ }, "name": "x" }, - "static": false, "value": null }, { @@ -124,6 +124,7 @@ "column": 7 } }, + "static": false, "computed": true, "key": { "type": "StringLiteral", @@ -145,7 +146,6 @@ }, "value": "y" }, - "static": false, "value": null } ] @@ -212,6 +212,7 @@ "column": 5 } }, + "static": false, "computed": true, "key": { "type": "Identifier", @@ -230,7 +231,6 @@ }, "name": "p" }, - "static": false, "value": null }, { @@ -247,6 +247,7 @@ "column": 11 } }, + "static": false, "computed": true, "key": { "type": "Identifier", @@ -265,7 +266,6 @@ }, "name": "m" }, - "static": false, "kind": "method", "id": null, "generator": false, diff --git a/test/fixtures/experimental/class-properties/edge-cases/expected.json b/test/fixtures/experimental/class-properties/edge-cases/expected.json index 3a41800a0b..e029628a70 100644 --- a/test/fixtures/experimental/class-properties/edge-cases/expected.json +++ b/test/fixtures/experimental/class-properties/edge-cases/expected.json @@ -1335,7 +1335,6 @@ } }, "static": false, - "kind": "get", "computed": true, "key": { "type": "StringLiteral", @@ -1357,6 +1356,7 @@ }, "value": "a" }, + "kind": "get", "id": null, "generator": false, "expression": false, @@ -1445,7 +1445,6 @@ } }, "static": true, - "kind": "get", "computed": false, "key": { "type": "Identifier", @@ -1464,6 +1463,7 @@ }, "name": "static" }, + "kind": "get", "id": null, "generator": false, "expression": false, diff --git a/test/fixtures/experimental/decorators/class-method-parameter/expected.json b/test/fixtures/experimental/decorators/class-method-parameter/expected.json index db2bccbfcb..4a401fa758 100644 --- a/test/fixtures/experimental/decorators/class-method-parameter/expected.json +++ b/test/fixtures/experimental/decorators/class-method-parameter/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 53 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,15 +103,16 @@ "end": { "line": 2, "column": 13 - } + }, + "identifierName": "constructor" }, "name": "constructor" }, - "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -123,7 +126,8 @@ "end": { "line": 2, "column": 22 - } + }, + "identifierName": "x" }, "name": "x", "decorators": [ @@ -167,7 +171,8 @@ "end": { "line": 2, "column": 18 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -188,7 +193,8 @@ "end": { "line": 2, "column": 49 - } + }, + "identifierName": "y" }, "name": "y", "decorators": [ @@ -232,7 +238,8 @@ "end": { "line": 2, "column": 28 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -281,7 +288,8 @@ "end": { "line": 2, "column": 32 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -351,7 +359,8 @@ "end": { "line": 2, "column": 45 - } + }, + "identifierName": "baz" }, "name": "baz" }, diff --git a/test/fixtures/experimental/decorators/computed-member-expr-on-prop/expected.json b/test/fixtures/experimental/decorators/computed-member-expr-on-prop/expected.json index 184415bff7..16385a68fc 100644 --- a/test/fixtures/experimental/decorators/computed-member-expr-on-prop/expected.json +++ b/test/fixtures/experimental/decorators/computed-member-expr-on-prop/expected.json @@ -156,6 +156,7 @@ } } ], + "static": false, "computed": false, "key": { "type": "Identifier", @@ -174,7 +175,6 @@ }, "name": "a" }, - "static": false, "value": { "type": "NumericLiteral", "start": 28, diff --git a/test/fixtures/experimental/decorators/computed-member-expression/expected.json b/test/fixtures/experimental/decorators/computed-member-expression/expected.json index d0c4947e9b..71b00fd8a1 100644 --- a/test/fixtures/experimental/decorators/computed-member-expression/expected.json +++ b/test/fixtures/experimental/decorators/computed-member-expression/expected.json @@ -156,6 +156,7 @@ } } ], + "static": false, "computed": false, "key": { "type": "Identifier", @@ -174,7 +175,6 @@ }, "name": "abc" }, - "static": false, "kind": "method", "id": null, "generator": false, diff --git a/test/fixtures/experimental/decorators/export-decorators-on-class/expected.json b/test/fixtures/experimental/decorators/export-decorators-on-class/expected.json index 343060fcaf..6933de60e7 100644 --- a/test/fixtures/experimental/decorators/export-decorators-on-class/expected.json +++ b/test/fixtures/experimental/decorators/export-decorators-on-class/expected.json @@ -56,24 +56,6 @@ "column": 23 } }, - "id": null, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 23 - } - }, - "body": [] - }, "decorators": [ { "type": "Decorator", @@ -107,7 +89,25 @@ "name": "foo" } } - ] + ], + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "body": [] + } } } ], diff --git a/test/fixtures/experimental/decorators/export-default-declaration-function-declaration-parameter/expected.json b/test/fixtures/experimental/decorators/export-default-declaration-function-declaration-parameter/expected.json index 7905089635..a936f5fee4 100644 --- a/test/fixtures/experimental/decorators/export-default-declaration-function-declaration-parameter/expected.json +++ b/test/fixtures/experimental/decorators/export-default-declaration-function-declaration-parameter/expected.json @@ -68,12 +68,14 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "func" }, "name": "func" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -87,7 +89,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "x" }, "name": "x", "decorators": [ @@ -131,7 +134,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -152,7 +156,8 @@ "end": { "line": 1, "column": 64 - } + }, + "identifierName": "y" }, "name": "y", "decorators": [ @@ -196,7 +201,8 @@ "end": { "line": 1, "column": 43 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -245,7 +251,8 @@ "end": { "line": 1, "column": 47 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -315,7 +322,8 @@ "end": { "line": 1, "column": 60 - } + }, + "identifierName": "baz" }, "name": "baz" }, diff --git a/test/fixtures/experimental/decorators/export-default-with-nested-class/expected.json b/test/fixtures/experimental/decorators/export-default-with-nested-class/expected.json index 8fc784a7a3..2c797decfc 100644 --- a/test/fixtures/experimental/decorators/export-default-with-nested-class/expected.json +++ b/test/fixtures/experimental/decorators/export-default-with-nested-class/expected.json @@ -56,23 +56,6 @@ "column": 1 } }, - "id": { - "type": "Identifier", - "start": 38, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "ParentClass" - }, - "name": "ParentClass" - }, "decorators": [ { "type": "Decorator", @@ -107,6 +90,23 @@ } } ], + "id": { + "type": "Identifier", + "start": 38, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 32 + }, + "identifierName": "ParentClass" + }, + "name": "ParentClass" + }, "superClass": null, "body": { "type": "ClassBody", @@ -137,6 +137,7 @@ "column": 3 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -155,7 +156,6 @@ }, "name": "makeNestedClass" }, - "static": false, "kind": "method", "id": null, "generator": false, diff --git a/test/fixtures/experimental/decorators/function-declaration-parameter/expected.json b/test/fixtures/experimental/decorators/function-declaration-parameter/expected.json index 8d6e1bf9f3..2949fbdb5c 100644 --- a/test/fixtures/experimental/decorators/function-declaration-parameter/expected.json +++ b/test/fixtures/experimental/decorators/function-declaration-parameter/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "func" }, "name": "func" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "x" }, "name": "x", "decorators": [ @@ -117,7 +120,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -138,7 +142,8 @@ "end": { "line": 1, "column": 49 - } + }, + "identifierName": "y" }, "name": "y", "decorators": [ @@ -182,7 +187,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -231,7 +237,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -301,7 +308,8 @@ "end": { "line": 1, "column": 45 - } + }, + "identifierName": "baz" }, "name": "baz" }, diff --git a/test/fixtures/experimental/decorators/function-expression-parameter/expected.json b/test/fixtures/experimental/decorators/function-expression-parameter/expected.json index 8c82bbc2f3..652a728e04 100644 --- a/test/fixtures/experimental/decorators/function-expression-parameter/expected.json +++ b/test/fixtures/experimental/decorators/function-expression-parameter/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "func" }, "name": "func" }, @@ -90,6 +91,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -103,7 +105,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "x" }, "name": "x", "decorators": [ @@ -147,7 +150,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -168,7 +172,8 @@ "end": { "line": 1, "column": 58 - } + }, + "identifierName": "y" }, "name": "y", "decorators": [ @@ -212,7 +217,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -261,7 +267,8 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -331,7 +338,8 @@ "end": { "line": 1, "column": 54 - } + }, + "identifierName": "baz" }, "name": "baz" }, diff --git a/test/fixtures/experimental/decorators/object-method-parameter/expected.json b/test/fixtures/experimental/decorators/object-method-parameter/expected.json index 08600db91a..5a22cd58ee 100644 --- a/test/fixtures/experimental/decorators/object-method-parameter/expected.json +++ b/test/fixtures/experimental/decorators/object-method-parameter/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "obj" }, "name": "obj" }, @@ -117,7 +118,8 @@ "end": { "line": 2, "column": 8 - } + }, + "identifierName": "method" }, "name": "method" }, @@ -125,6 +127,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -138,7 +141,8 @@ "end": { "line": 2, "column": 17 - } + }, + "identifierName": "x" }, "name": "x", "decorators": [ @@ -182,7 +186,8 @@ "end": { "line": 2, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -203,7 +208,8 @@ "end": { "line": 2, "column": 44 - } + }, + "identifierName": "y" }, "name": "y", "decorators": [ @@ -247,7 +253,8 @@ "end": { "line": 2, "column": 23 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -296,7 +303,8 @@ "end": { "line": 2, "column": 27 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -366,7 +374,8 @@ "end": { "line": 2, "column": 40 - } + }, + "identifierName": "baz" }, "name": "baz" }, diff --git a/test/fixtures/experimental/function-sent/inside-generator/expected.json b/test/fixtures/experimental/function-sent/inside-generator/expected.json index c0692c9a9d..bfacd5b28e 100644 --- a/test/fixtures/experimental/function-sent/inside-generator/expected.json +++ b/test/fixtures/experimental/function-sent/inside-generator/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": true, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -116,7 +118,8 @@ "end": { "line": 2, "column": 17 - } + }, + "identifierName": "function" }, "name": "function" }, @@ -132,7 +135,8 @@ "end": { "line": 2, "column": 22 - } + }, + "identifierName": "sent" }, "name": "sent" } diff --git a/test/fixtures/experimental/object-rest-spread/1/expected.json b/test/fixtures/experimental/object-rest-spread/1/expected.json index ee18f60048..5a26deddd0 100644 --- a/test/fixtures/experimental/object-rest-spread/1/expected.json +++ b/test/fixtures/experimental/object-rest-spread/1/expected.json @@ -98,7 +98,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "x" }, "name": "x" } @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "z" }, "name": "z" } @@ -128,4 +130,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/10/expected.json b/test/fixtures/experimental/object-rest-spread/10/expected.json index 181a07c888..bce210e65b 100644 --- a/test/fixtures/experimental/object-rest-spread/10/expected.json +++ b/test/fixtures/experimental/object-rest-spread/10/expected.json @@ -208,4 +208,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/16/expected.json b/test/fixtures/experimental/object-rest-spread/16/expected.json index a722ab4fb5..cd68bed7a3 100644 --- a/test/fixtures/experimental/object-rest-spread/16/expected.json +++ b/test/fixtures/experimental/object-rest-spread/16/expected.json @@ -240,4 +240,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/17/expected.json b/test/fixtures/experimental/object-rest-spread/17/expected.json index fa2ec13b14..c6d9695d8b 100644 --- a/test/fixtures/experimental/object-rest-spread/17/expected.json +++ b/test/fixtures/experimental/object-rest-spread/17/expected.json @@ -275,4 +275,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/2/expected.json b/test/fixtures/experimental/object-rest-spread/2/expected.json index 3e67ea3d00..77ad59f8cb 100644 --- a/test/fixtures/experimental/object-rest-spread/2/expected.json +++ b/test/fixtures/experimental/object-rest-spread/2/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } }, { @@ -148,7 +153,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "y" }, "name": "y" } @@ -167,7 +173,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "z" }, "name": "z" } @@ -178,4 +185,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/3/expected.json b/test/fixtures/experimental/object-rest-spread/3/expected.json index 170cb077f2..bb0cd7a162 100644 --- a/test/fixtures/experimental/object-rest-spread/3/expected.json +++ b/test/fixtures/experimental/object-rest-spread/3/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ObjectPattern", @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -120,9 +122,13 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } }, { @@ -151,7 +157,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "y" }, "name": "y" } @@ -177,11 +184,12 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/4/expected.json b/test/fixtures/experimental/object-rest-spread/4/expected.json index 1d025448b2..8b971ee635 100644 --- a/test/fixtures/experimental/object-rest-spread/4/expected.json +++ b/test/fixtures/experimental/object-rest-spread/4/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "z" }, "name": "z" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" } @@ -125,6 +127,7 @@ ], "kind": "let" } - ] + ], + "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/5/expected.json b/test/fixtures/experimental/object-rest-spread/5/expected.json index 4089ed42a6..efbc0e3f05 100644 --- a/test/fixtures/experimental/object-rest-spread/5/expected.json +++ b/test/fixtures/experimental/object-rest-spread/5/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "z" }, "name": "z" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -133,9 +135,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } }, { @@ -164,7 +170,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "y" }, "name": "y" } @@ -176,4 +183,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/object-rest-spread/6/expected.json b/test/fixtures/experimental/object-rest-spread/6/expected.json index 4950385f5f..0584ebbbe7 100644 --- a/test/fixtures/experimental/object-rest-spread/6/expected.json +++ b/test/fixtures/experimental/object-rest-spread/6/expected.json @@ -296,4 +296,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/33/expected.json b/test/fixtures/experimental/uncategorised/33/expected.json index 11f4e10cdb..027ed9cf62 100644 --- a/test/fixtures/experimental/uncategorised/33/expected.json +++ b/test/fixtures/experimental/uncategorised/33/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -87,7 +88,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -109,6 +111,7 @@ "body": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/34/expected.json b/test/fixtures/experimental/uncategorised/34/expected.json index 8186beeeb5..923fccd749 100644 --- a/test/fixtures/experimental/uncategorised/34/expected.json +++ b/test/fixtures/experimental/uncategorised/34/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -114,7 +115,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -132,7 +134,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -158,6 +161,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/35/expected.json b/test/fixtures/experimental/uncategorised/35/expected.json index ff000260aa..99edaedb74 100644 --- a/test/fixtures/experimental/uncategorised/35/expected.json +++ b/test/fixtures/experimental/uncategorised/35/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -115,12 +116,14 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "foo" }, "name": "foo" } } ], + "static": false, "computed": false, "key": { "type": "Identifier", @@ -134,15 +137,16 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/experimental/uncategorised/36/expected.json b/test/fixtures/experimental/uncategorised/36/expected.json index 118d2b69c5..74f8fb569a 100644 --- a/test/fixtures/experimental/uncategorised/36/expected.json +++ b/test/fixtures/experimental/uncategorised/36/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -115,12 +116,14 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "foo" }, "name": "foo" } } ], + "static": false, "computed": false, "key": { "type": "Identifier", @@ -134,15 +137,16 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": false, "kind": "set", "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -156,7 +160,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "f" }, "name": "f" } diff --git a/test/fixtures/experimental/uncategorised/37/expected.json b/test/fixtures/experimental/uncategorised/37/expected.json index ad67c94592..cc23bfd6b2 100644 --- a/test/fixtures/experimental/uncategorised/37/expected.json +++ b/test/fixtures/experimental/uncategorised/37/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -115,12 +116,14 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "foo" }, "name": "foo" } } ], + "static": false, "computed": false, "key": { "type": "Identifier", @@ -134,15 +137,16 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": false, "kind": "get", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/experimental/uncategorised/38/expected.json b/test/fixtures/experimental/uncategorised/38/expected.json index d55670aa51..621411c8b8 100644 --- a/test/fixtures/experimental/uncategorised/38/expected.json +++ b/test/fixtures/experimental/uncategorised/38/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -146,12 +148,14 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "bar" }, "name": "bar" } } ], + "static": false, "computed": false, "key": { "type": "Identifier", @@ -165,15 +169,16 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": false, "kind": "method", "id": null, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", diff --git a/test/fixtures/experimental/uncategorised/39/expected.json b/test/fixtures/experimental/uncategorised/39/expected.json index b8e2fae3e8..29893aa8b2 100644 --- a/test/fixtures/experimental/uncategorised/39/expected.json +++ b/test/fixtures/experimental/uncategorised/39/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -144,7 +145,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -165,7 +167,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -221,7 +224,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -239,7 +243,8 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, diff --git a/test/fixtures/experimental/uncategorised/40/expected.json b/test/fixtures/experimental/uncategorised/40/expected.json index 561ed2763d..1303f6d2b6 100644 --- a/test/fixtures/experimental/uncategorised/40/expected.json +++ b/test/fixtures/experimental/uncategorised/40/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -87,7 +88,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -132,7 +134,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -150,7 +153,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "Bar" }, "name": "Bar" }, @@ -189,6 +193,7 @@ "body": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/43/expected.json b/test/fixtures/experimental/uncategorised/43/expected.json index f1956ad133..b5e0eed1ee 100644 --- a/test/fixtures/experimental/uncategorised/43/expected.json +++ b/test/fixtures/experimental/uncategorised/43/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 24 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "value": { "type": "StringLiteral", "start": 18, diff --git a/test/fixtures/experimental/uncategorised/44/expected.json b/test/fixtures/experimental/uncategorised/44/expected.json index f0a0229229..0bd96ae88c 100644 --- a/test/fixtures/experimental/uncategorised/44/expected.json +++ b/test/fixtures/experimental/uncategorised/44/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 16 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,16 +103,17 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "value": null } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/45/expected.json b/test/fixtures/experimental/uncategorised/45/expected.json index 5b0f534e52..9c603e0ed1 100644 --- a/test/fixtures/experimental/uncategorised/45/expected.json +++ b/test/fixtures/experimental/uncategorised/45/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 23 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,16 +103,17 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "value": null } ] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/experimental/uncategorised/46/expected.json b/test/fixtures/experimental/uncategorised/46/expected.json index ade2f517c1..221e6c8c0a 100644 --- a/test/fixtures/experimental/uncategorised/46/expected.json +++ b/test/fixtures/experimental/uncategorised/46/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 31 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "value": { "type": "StringLiteral", "start": 25, diff --git a/test/fixtures/experimental/uncategorised/47/expected.json b/test/fixtures/experimental/uncategorised/47/expected.json index e13785eb68..d638426ba2 100644 --- a/test/fixtures/experimental/uncategorised/47/expected.json +++ b/test/fixtures/experimental/uncategorised/47/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -115,12 +116,14 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" } } ], + "static": false, "computed": false, "key": { "type": "Identifier", @@ -134,11 +137,11 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "value": { "type": "StringLiteral", "start": 23, diff --git a/test/fixtures/experimental/uncategorised/48/expected.json b/test/fixtures/experimental/uncategorised/48/expected.json index 9f756cd6cb..2dfeed15ab 100644 --- a/test/fixtures/experimental/uncategorised/48/expected.json +++ b/test/fixtures/experimental/uncategorised/48/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -115,12 +116,14 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" } } ], + "static": true, "computed": false, "key": { "type": "Identifier", @@ -134,11 +137,11 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": true, "value": { "type": "StringLiteral", "start": 30, diff --git a/test/fixtures/experimental/uncategorised/49/expected.json b/test/fixtures/experimental/uncategorised/49/expected.json index 1186fc6b42..a339588287 100644 --- a/test/fixtures/experimental/uncategorised/49/expected.json +++ b/test/fixtures/experimental/uncategorised/49/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "obj" }, "name": "obj" }, @@ -129,7 +130,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -150,7 +152,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "bar" }, "name": "bar" }, diff --git a/test/fixtures/experimental/uncategorised/50/expected.json b/test/fixtures/experimental/uncategorised/50/expected.json index c901163da6..7d5e584066 100644 --- a/test/fixtures/experimental/uncategorised/50/expected.json +++ b/test/fixtures/experimental/uncategorised/50/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -100,7 +101,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/experimental/uncategorised/51/expected.json b/test/fixtures/experimental/uncategorised/51/expected.json index cf777d23e3..c3ff5e5a66 100644 --- a/test/fixtures/experimental/uncategorised/51/expected.json +++ b/test/fixtures/experimental/uncategorised/51/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -100,7 +101,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/experimental/uncategorised/52/expected.json b/test/fixtures/experimental/uncategorised/52/expected.json index 56f6998476..fb3dbdc979 100644 --- a/test/fixtures/experimental/uncategorised/52/expected.json +++ b/test/fixtures/experimental/uncategorised/52/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/experimental/uncategorised/53/expected.json b/test/fixtures/experimental/uncategorised/53/expected.json index 8e1fc31aea..72a96cf589 100644 --- a/test/fixtures/experimental/uncategorised/53/expected.json +++ b/test/fixtures/experimental/uncategorised/53/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "default" }, "name": "default" } diff --git a/test/fixtures/experimental/uncategorised/54/expected.json b/test/fixtures/experimental/uncategorised/54/expected.json index 90607f31ac..b92718dd1b 100644 --- a/test/fixtures/experimental/uncategorised/54/expected.json +++ b/test/fixtures/experimental/uncategorised/54/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/experimental/uncategorised/62/expected.json b/test/fixtures/experimental/uncategorised/62/expected.json index 8b52f4f5bb..e8bfb35773 100644 --- a/test/fixtures/experimental/uncategorised/62/expected.json +++ b/test/fixtures/experimental/uncategorised/62/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "decorate" }, "name": "decorate" }, @@ -105,6 +106,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -118,7 +120,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "arg" }, "name": "arg" } @@ -155,7 +158,8 @@ "end": { "line": 2, "column": 8 - } + }, + "identifierName": "Ex" }, "name": "Ex" }, @@ -177,6 +181,7 @@ "body": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/flow/anonymous-function-no-parens-types/good_03/expected.json b/test/fixtures/flow/anonymous-function-no-parens-types/good_03/expected.json index a09644e718..15898b8a3f 100644 --- a/test/fixtures/flow/anonymous-function-no-parens-types/good_03/expected.json +++ b/test/fixtures/flow/anonymous-function-no-parens-types/good_03/expected.json @@ -116,7 +116,8 @@ "column": 18 } } - } + }, + "predicate": null }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-no-parens-types/good_04/expected.json b/test/fixtures/flow/anonymous-function-no-parens-types/good_04/expected.json index 7383572fa8..4826089df7 100644 --- a/test/fixtures/flow/anonymous-function-no-parens-types/good_04/expected.json +++ b/test/fixtures/flow/anonymous-function-no-parens-types/good_04/expected.json @@ -148,7 +148,8 @@ } } ] - } + }, + "predicate": null }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json b/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json index 94ac983cb5..4aac5e5b7b 100644 --- a/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json +++ b/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json @@ -177,14 +177,15 @@ "column": 27 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "123" - } + }, + "value": 123 }, "typeParameters": null - } + }, + "predicate": null }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-types/good_01/expected.json b/test/fixtures/flow/anonymous-function-types/good_01/expected.json index 49ef79cba3..f81ca57295 100644 --- a/test/fixtures/flow/anonymous-function-types/good_01/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_01/expected.json @@ -185,7 +185,8 @@ } } } - } + }, + "predicate": null } } } diff --git a/test/fixtures/flow/anonymous-function-types/good_10/expected.json b/test/fixtures/flow/anonymous-function-types/good_10/expected.json index ffb3d792e6..6f6b8d5c5f 100644 --- a/test/fixtures/flow/anonymous-function-types/good_10/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_10/expected.json @@ -181,14 +181,15 @@ "column": 31 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "123" - } + }, + "value": 123 }, "typeParameters": null - } + }, + "predicate": null }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-types/good_11/expected.json b/test/fixtures/flow/anonymous-function-types/good_11/expected.json index 0cdbecd783..f4bff8d5de 100644 --- a/test/fixtures/flow/anonymous-function-types/good_11/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_11/expected.json @@ -116,7 +116,8 @@ "column": 19 } } - } + }, + "predicate": null }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-types/good_12/expected.json b/test/fixtures/flow/anonymous-function-types/good_12/expected.json index cd8dec7223..862a858093 100644 --- a/test/fixtures/flow/anonymous-function-types/good_12/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_12/expected.json @@ -148,7 +148,8 @@ } } ] - } + }, + "predicate": null }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-types/good_13/expected.json b/test/fixtures/flow/anonymous-function-types/good_13/expected.json index 829f2cc872..ea21215b6a 100644 --- a/test/fixtures/flow/anonymous-function-types/good_13/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_13/expected.json @@ -171,14 +171,15 @@ "column": 29 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "123" - } + }, + "value": 123 }, "typeParameters": null - } + }, + "predicate": null }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-types/good_14/expected.json b/test/fixtures/flow/anonymous-function-types/good_14/expected.json index 72b991f723..d61b3e631d 100644 --- a/test/fixtures/flow/anonymous-function-types/good_14/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_14/expected.json @@ -131,11 +131,11 @@ "column": 16 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 }, { "type": "NumberLiteralTypeAnnotation", @@ -151,14 +151,15 @@ "column": 20 } }, - "value": 2, "extra": { "rawValue": 2, "raw": "2" - } + }, + "value": 2 } ] - } + }, + "predicate": null }, "id": null, "generator": false, diff --git a/test/fixtures/flow/array-types/1/expected.json b/test/fixtures/flow/array-types/1/expected.json index ec761b745f..4a628f8b88 100644 --- a/test/fixtures/flow/array-types/1/expected.json +++ b/test/fixtures/flow/array-types/1/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -123,7 +124,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/2/expected.json b/test/fixtures/flow/array-types/2/expected.json index 1c35be8908..ac973c42c3 100644 --- a/test/fixtures/flow/array-types/2/expected.json +++ b/test/fixtures/flow/array-types/2/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -138,7 +139,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/3/expected.json b/test/fixtures/flow/array-types/3/expected.json index 3bc1a328ed..97f2e67bb2 100644 --- a/test/fixtures/flow/array-types/3/expected.json +++ b/test/fixtures/flow/array-types/3/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -138,7 +139,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/4/expected.json b/test/fixtures/flow/array-types/4/expected.json index 9af2946b1c..1e607ecb92 100644 --- a/test/fixtures/flow/array-types/4/expected.json +++ b/test/fixtures/flow/array-types/4/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -141,7 +142,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/5/expected.json b/test/fixtures/flow/array-types/5/expected.json index 3c6ed8b705..1d9bb7f09e 100644 --- a/test/fixtures/flow/array-types/5/expected.json +++ b/test/fixtures/flow/array-types/5/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -141,7 +142,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/6/expected.json b/test/fixtures/flow/array-types/6/expected.json index 07cd5aeb7a..75d9b0ed40 100644 --- a/test/fixtures/flow/array-types/6/expected.json +++ b/test/fixtures/flow/array-types/6/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -141,7 +142,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "A" }, "name": "A" } @@ -155,7 +157,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/array-types/7/expected.json b/test/fixtures/flow/array-types/7/expected.json index dc3060e046..075d711fea 100644 --- a/test/fixtures/flow/array-types/7/expected.json +++ b/test/fixtures/flow/array-types/7/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -138,7 +139,7 @@ ], "kind": "var" } - ] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/array-types/8/expected.json b/test/fixtures/flow/array-types/8/expected.json index 624bd8732a..5942211299 100644 --- a/test/fixtures/flow/array-types/8/expected.json +++ b/test/fixtures/flow/array-types/8/expected.json @@ -26,6 +26,7 @@ "column": 19 } }, + "sourceType": "module", "body": [ { "type": "VariableDeclaration", @@ -68,7 +69,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -152,7 +154,7 @@ ], "kind": "var" } - ] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/array-types/9/expected.json b/test/fixtures/flow/array-types/9/expected.json index 9ac33d433a..fffc354953 100644 --- a/test/fixtures/flow/array-types/9/expected.json +++ b/test/fixtures/flow/array-types/9/expected.json @@ -26,6 +26,7 @@ "column": 2 } }, + "sourceType": "module", "body": [ { "type": "VariableDeclaration", @@ -68,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -138,7 +140,7 @@ "elements": [] } } - ] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/bounded-polymorphism/1/expected.json b/test/fixtures/flow/bounded-polymorphism/1/expected.json index dd5b6e120d..5f53d9572e 100644 --- a/test/fixtures/flow/bounded-polymorphism/1/expected.json +++ b/test/fixtures/flow/bounded-polymorphism/1/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -88,6 +89,7 @@ } }, "name": "T", + "variance": null, "bound": { "type": "TypeAnnotation", "start": 9, @@ -129,7 +131,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "Foo" }, "name": "Foo" } diff --git a/test/fixtures/flow/bounded-polymorphism/2/expected.json b/test/fixtures/flow/bounded-polymorphism/2/expected.json index cce66b9065..e7f5ee680d 100644 --- a/test/fixtures/flow/bounded-polymorphism/2/expected.json +++ b/test/fixtures/flow/bounded-polymorphism/2/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -91,6 +92,7 @@ } }, "name": "T", + "variance": null, "bound": { "type": "TypeAnnotation", "start": 14, diff --git a/test/fixtures/flow/call-properties/1/expected.json b/test/fixtures/flow/call-properties/1/expected.json index 35b90b3c11..6ea3d1e4bb 100644 --- a/test/fixtures/flow/call-properties/1/expected.json +++ b/test/fixtures/flow/call-properties/1/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -115,6 +116,7 @@ "column": 20 } }, + "static": false, "value": { "type": "FunctionTypeAnnotation", "start": 10, @@ -151,7 +153,8 @@ } ], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -160,7 +163,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/call-properties/2/expected.json b/test/fixtures/flow/call-properties/2/expected.json index ddb97cd917..2efe8bd9d6 100644 --- a/test/fixtures/flow/call-properties/2/expected.json +++ b/test/fixtures/flow/call-properties/2/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -115,6 +116,7 @@ "column": 21 } }, + "static": false, "value": { "type": "FunctionTypeAnnotation", "start": 10, @@ -151,7 +153,8 @@ } ], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -160,7 +163,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/call-properties/3/expected.json b/test/fixtures/flow/call-properties/3/expected.json index cd2eadb7d0..e1c7645c97 100644 --- a/test/fixtures/flow/call-properties/3/expected.json +++ b/test/fixtures/flow/call-properties/3/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 54 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -115,6 +116,7 @@ "column": 21 } }, + "static": false, "value": { "type": "FunctionTypeAnnotation", "start": 10, @@ -163,6 +165,7 @@ "column": 52 } }, + "static": false, "value": { "type": "FunctionTypeAnnotation", "start": 33, @@ -204,7 +207,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -273,7 +277,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -293,10 +298,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -305,7 +312,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/call-properties/4/expected.json b/test/fixtures/flow/call-properties/4/expected.json index 4fefc20fda..bbfa2011f1 100644 --- a/test/fixtures/flow/call-properties/4/expected.json +++ b/test/fixtures/flow/call-properties/4/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -115,6 +116,7 @@ "column": 28 } }, + "static": false, "value": { "type": "FunctionTypeAnnotation", "start": 10, @@ -156,7 +158,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -188,7 +191,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "T" }, "name": "T" } @@ -225,7 +229,8 @@ "column": 12 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -248,7 +253,8 @@ } ], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } }, diff --git a/test/fixtures/flow/call-properties/5/expected.json b/test/fixtures/flow/call-properties/5/expected.json index 4815e902bc..c836470490 100644 --- a/test/fixtures/flow/call-properties/5/expected.json +++ b/test/fixtures/flow/call-properties/5/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "A" }, "name": "A" }, "typeParameters": null, "extends": [], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 12, @@ -126,10 +128,11 @@ } ], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/1/expected.json b/test/fixtures/flow/declare-module/1/expected.json index 6c62e08565..543af8e16b 100644 --- a/test/fixtures/flow/declare-module/1/expected.json +++ b/test/fixtures/flow/declare-module/1/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -75,7 +76,7 @@ "body": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/3/expected.json b/test/fixtures/flow/declare-module/3/expected.json index 8654fdf948..b390a8eba8 100644 --- a/test/fixtures/flow/declare-module/3/expected.json +++ b/test/fixtures/flow/declare-module/3/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -137,7 +139,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/4/expected.json b/test/fixtures/flow/declare-module/4/expected.json index e53817230a..89bdb1f60c 100644 --- a/test/fixtures/flow/declare-module/4/expected.json +++ b/test/fixtures/flow/declare-module/4/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 49 - } + }, + "identifierName": "foo" }, "name": "foo", "typeAnnotation": { @@ -148,14 +150,15 @@ } } } - } + }, + "predicate": null } } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/5/expected.json b/test/fixtures/flow/declare-module/5/expected.json index 5da254c476..2933f44c40 100644 --- a/test/fixtures/flow/declare-module/5/expected.json +++ b/test/fixtures/flow/declare-module/5/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -99,12 +100,14 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "B" }, "name": "B" }, "typeParameters": null, "extends": [], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 35, @@ -168,6 +171,7 @@ } } }, + "static": false, "key": { "type": "Identifier", "start": 37, @@ -180,20 +184,22 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "foo" }, "name": "foo" }, "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/6/expected.json b/test/fixtures/flow/declare-module/6/expected.json index 713a1d71c1..cd42bf7057 100644 --- a/test/fixtures/flow/declare-module/6/expected.json +++ b/test/fixtures/flow/declare-module/6/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -164,6 +165,7 @@ } } }, + "static": false, "key": { "type": "Identifier", "start": 45, @@ -176,14 +178,16 @@ "end": { "line": 1, "column": 48 - } + }, + "identifierName": "foo" }, "name": "foo" }, "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } } diff --git a/test/fixtures/flow/declare-statements/1/expected.json b/test/fixtures/flow/declare-statements/1/expected.json index c09b84fcf9..de51d0d730 100644 --- a/test/fixtures/flow/declare-statements/1/expected.json +++ b/test/fixtures/flow/declare-statements/1/expected.json @@ -54,12 +54,13 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "foo" }, "name": "foo" } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/10/expected.json b/test/fixtures/flow/declare-statements/10/expected.json index 9254cba4fe..a047f9c004 100644 --- a/test/fixtures/flow/declare-statements/10/expected.json +++ b/test/fixtures/flow/declare-statements/10/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "A" }, "name": "A" }, "typeParameters": null, "extends": [], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 16, @@ -136,7 +138,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -168,7 +171,8 @@ "end": { "line": 1, "column": 48 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -192,10 +196,11 @@ "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/11/expected.json b/test/fixtures/flow/declare-statements/11/expected.json index cbc8903f9e..6c57828705 100644 --- a/test/fixtures/flow/declare-statements/11/expected.json +++ b/test/fixtures/flow/declare-statements/11/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "A" }, "name": "A" }, "typeParameters": null, "extends": [], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 16, @@ -104,7 +106,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "indexer" }, "name": "indexer" }, @@ -140,10 +143,11 @@ }, "variance": null } - ] + ], + "exact": false } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/12/expected.json b/test/fixtures/flow/declare-statements/12/expected.json index 5ff774491c..d7e3836060 100644 --- a/test/fixtures/flow/declare-statements/12/expected.json +++ b/test/fixtures/flow/declare-statements/12/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "A" }, "name": "A" }, "typeParameters": null, "extends": [], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 16, @@ -126,10 +128,11 @@ } ], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/13/expected.json b/test/fixtures/flow/declare-statements/13/expected.json index 28eabe6252..2e0f0e768e 100644 --- a/test/fixtures/flow/declare-statements/13/expected.json +++ b/test/fixtures/flow/declare-statements/13/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -87,7 +88,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -133,7 +135,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "T" }, "name": "T" } @@ -167,7 +170,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "C" }, "name": "C" }, @@ -190,7 +194,8 @@ }, "callProperties": [], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } ], diff --git a/test/fixtures/flow/declare-statements/14/expected.json b/test/fixtures/flow/declare-statements/14/expected.json index a43cb40adf..ea11ee2d77 100644 --- a/test/fixtures/flow/declare-statements/14/expected.json +++ b/test/fixtures/flow/declare-statements/14/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -101,7 +102,8 @@ "end": { "line": 2, "column": 14 - } + }, + "identifierName": "T" }, "name": "T" }, @@ -134,7 +136,8 @@ "column": 16 } }, - "name": "U" + "name": "U", + "variance": null } ] }, @@ -169,6 +172,7 @@ "column": 35 } }, + "static": false, "id": { "type": "Identifier", "start": 48, @@ -181,7 +185,8 @@ "end": { "line": 2, "column": 24 - } + }, + "identifierName": "k" }, "name": "k" }, @@ -227,14 +232,16 @@ "end": { "line": 2, "column": 35 - } + }, + "identifierName": "U" }, "name": "U" } }, "variance": null } - ] + ], + "exact": false } } ], diff --git a/test/fixtures/flow/declare-statements/15/expected.json b/test/fixtures/flow/declare-statements/15/expected.json index 81024f30bd..0b5376ca37 100644 --- a/test/fixtures/flow/declare-statements/15/expected.json +++ b/test/fixtures/flow/declare-statements/15/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "I" }, "name": "I" }, @@ -103,7 +104,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -123,10 +125,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } }, { @@ -155,7 +159,8 @@ "end": { "line": 2, "column": 19 - } + }, + "identifierName": "I" }, "name": "I" }, @@ -188,7 +193,8 @@ "column": 21 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -236,7 +242,8 @@ "end": { "line": 2, "column": 28 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -267,16 +274,19 @@ "end": { "line": 2, "column": 31 - } + }, + "identifierName": "T" }, "name": "T" } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } ], diff --git a/test/fixtures/flow/declare-statements/16/expected.json b/test/fixtures/flow/declare-statements/16/expected.json index 4fbc1787d4..63647f77c7 100644 --- a/test/fixtures/flow/declare-statements/16/expected.json +++ b/test/fixtures/flow/declare-statements/16/expected.json @@ -176,7 +176,8 @@ }, "callProperties": [], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } ], diff --git a/test/fixtures/flow/declare-statements/2/expected.json b/test/fixtures/flow/declare-statements/2/expected.json index bed757d73f..f5ce52dc9e 100644 --- a/test/fixtures/flow/declare-statements/2/expected.json +++ b/test/fixtures/flow/declare-statements/2/expected.json @@ -54,12 +54,13 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "foo" }, "name": "foo" } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/3/expected.json b/test/fixtures/flow/declare-statements/3/expected.json index f77a398e93..ff4d67ffd4 100644 --- a/test/fixtures/flow/declare-statements/3/expected.json +++ b/test/fixtures/flow/declare-statements/3/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "foo" }, "name": "foo", "typeAnnotation": { @@ -103,11 +104,12 @@ } } } - } + }, + "predicate": null } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/4/expected.json b/test/fixtures/flow/declare-statements/4/expected.json index f5aaaa9224..a5c4e3c553 100644 --- a/test/fixtures/flow/declare-statements/4/expected.json +++ b/test/fixtures/flow/declare-statements/4/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "foo" }, "name": "foo", "typeAnnotation": { @@ -103,11 +104,12 @@ } } } - } + }, + "predicate": null } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/5/expected.json b/test/fixtures/flow/declare-statements/5/expected.json index c391cadcac..b93e58be9b 100644 --- a/test/fixtures/flow/declare-statements/5/expected.json +++ b/test/fixtures/flow/declare-statements/5/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "foo" }, "name": "foo", "typeAnnotation": { @@ -114,7 +115,8 @@ "column": 22 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -135,7 +137,8 @@ } } } - } + }, + "predicate": null } } } diff --git a/test/fixtures/flow/declare-statements/6/expected.json b/test/fixtures/flow/declare-statements/6/expected.json index c61da189d6..8c803e35a3 100644 --- a/test/fixtures/flow/declare-statements/6/expected.json +++ b/test/fixtures/flow/declare-statements/6/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 48 - } + }, + "identifierName": "foo" }, "name": "foo", "typeAnnotation": { @@ -113,7 +114,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -160,7 +162,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -198,11 +201,12 @@ } } } - } + }, + "predicate": null } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/7/expected.json b/test/fixtures/flow/declare-statements/7/expected.json index 04218670c8..1fd92b3412 100644 --- a/test/fixtures/flow/declare-statements/7/expected.json +++ b/test/fixtures/flow/declare-statements/7/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "IViewFactory" }, "name": "IViewFactory" }, "typeParameters": null, "extends": [], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 27, @@ -131,7 +133,8 @@ "end": { "line": 1, "column": 44 - } + }, + "identifierName": "view" }, "name": "view" }, @@ -163,7 +166,8 @@ "end": { "line": 1, "column": 51 - } + }, + "identifierName": "Object" }, "name": "Object" } @@ -195,7 +199,8 @@ "end": { "line": 1, "column": 57 - } + }, + "identifierName": "prop" }, "name": "prop" }, @@ -235,6 +240,7 @@ } } }, + "static": false, "key": { "type": "Identifier", "start": 29, @@ -247,17 +253,19 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "didAnimate" }, "name": "didAnimate" }, "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/8/expected.json b/test/fixtures/flow/declare-statements/8/expected.json index 18bc5e8955..3f5d39aa5f 100644 --- a/test/fixtures/flow/declare-statements/8/expected.json +++ b/test/fixtures/flow/declare-statements/8/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "A" }, "name": "A" }, "typeParameters": null, "extends": [], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 16, @@ -76,10 +78,11 @@ }, "callProperties": [], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/declare-statements/9/expected.json b/test/fixtures/flow/declare-statements/9/expected.json index d3d340e972..1ac09b01e8 100644 --- a/test/fixtures/flow/declare-statements/9/expected.json +++ b/test/fixtures/flow/declare-statements/9/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -87,7 +88,8 @@ "column": 17 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -118,7 +120,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -164,7 +167,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "T" }, "name": "T" } @@ -216,7 +220,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -236,10 +241,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } ], diff --git a/test/fixtures/flow/def-site-variance/1/expected.json b/test/fixtures/flow/def-site-variance/1/expected.json index d5e8a1b7b6..2ee9a406c5 100644 --- a/test/fixtures/flow/def-site-variance/1/expected.json +++ b/test/fixtures/flow/def-site-variance/1/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "C" }, "name": "C" }, @@ -87,6 +88,7 @@ "column": 10 } }, + "name": "T", "variance": { "type": "Variance", "start": 8, @@ -102,8 +104,7 @@ } }, "kind": "plus" - }, - "name": "T" + } }, { "type": "TypeParameter", @@ -119,6 +120,7 @@ "column": 13 } }, + "name": "U", "variance": { "type": "Variance", "start": 11, @@ -134,8 +136,7 @@ } }, "kind": "minus" - }, - "name": "U" + } } ] }, @@ -183,7 +184,8 @@ "end": { "line": 2, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -219,6 +221,7 @@ "column": 13 } }, + "name": "T", "variance": { "type": "Variance", "start": 29, @@ -234,8 +237,7 @@ } }, "kind": "plus" - }, - "name": "T" + } }, { "type": "TypeParameter", @@ -251,6 +253,7 @@ "column": 16 } }, + "name": "U", "variance": { "type": "Variance", "start": 32, @@ -266,8 +269,7 @@ } }, "kind": "minus" - }, - "name": "U" + } } ] }, @@ -316,7 +318,8 @@ "end": { "line": 3, "column": 6 - } + }, + "identifierName": "T" }, "name": "T" }, @@ -349,6 +352,7 @@ "column": 9 } }, + "name": "T", "variance": { "type": "Variance", "start": 48, @@ -364,8 +368,7 @@ } }, "kind": "plus" - }, - "name": "T" + } }, { "type": "TypeParameter", @@ -381,6 +384,7 @@ "column": 12 } }, + "name": "U", "variance": { "type": "Variance", "start": 51, @@ -396,8 +400,7 @@ } }, "kind": "minus" - }, - "name": "U" + } } ] }, @@ -417,10 +420,11 @@ }, "callProperties": [], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/1/expected.json b/test/fixtures/flow/interfaces-module-and-script/1/expected.json index f6196760be..005f5ae9d3 100644 --- a/test/fixtures/flow/interfaces-module-and-script/1/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/1/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "A" }, "name": "A" }, "typeParameters": null, "extends": [], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 12, @@ -76,10 +78,11 @@ }, "callProperties": [], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/2/expected.json b/test/fixtures/flow/interfaces-module-and-script/2/expected.json index 953e5928d5..044027ca74 100644 --- a/test/fixtures/flow/interfaces-module-and-script/2/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/2/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -86,13 +87,15 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "B" }, "name": "B" }, "typeParameters": null } ], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 22, @@ -109,10 +112,11 @@ }, "callProperties": [], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/3/expected.json b/test/fixtures/flow/interfaces-module-and-script/3/expected.json index ce900a2e99..2f896014d6 100644 --- a/test/fixtures/flow/interfaces-module-and-script/3/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/3/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -87,7 +88,8 @@ "column": 13 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -118,7 +120,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "B" }, "name": "B" }, @@ -164,7 +167,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "T" }, "name": "T" } @@ -198,7 +202,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "C" }, "name": "C" }, @@ -244,7 +249,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "T" }, "name": "T" } @@ -270,7 +276,8 @@ }, "callProperties": [], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } ], diff --git a/test/fixtures/flow/interfaces-module-and-script/4/expected.json b/test/fixtures/flow/interfaces-module-and-script/4/expected.json index 922afad5c6..b6b9f6d2c7 100644 --- a/test/fixtures/flow/interfaces-module-and-script/4/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/4/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "A" }, "name": "A" }, "typeParameters": null, "extends": [], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 12, @@ -102,7 +104,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -140,13 +143,15 @@ "typeParameters": null }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/5/expected.json b/test/fixtures/flow/interfaces-module-and-script/5/expected.json index 946ad67dca..58cbc95f06 100644 --- a/test/fixtures/flow/interfaces-module-and-script/5/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/5/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "Dictionary" }, "name": "Dictionary" }, "typeParameters": null, "extends": [], + "mixins": [], "body": { "type": "ObjectTypeAnnotation", "start": 21, @@ -102,7 +104,8 @@ "end": { "line": 1, "column": 54 - } + }, + "identifierName": "length" }, "name": "length" }, @@ -122,6 +125,7 @@ } }, "optional": false, + "static": false, "variance": null } ], @@ -140,6 +144,7 @@ "column": 46 } }, + "static": false, "id": { "type": "Identifier", "start": 24, @@ -152,7 +157,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "index" }, "name": "index" }, @@ -188,10 +194,11 @@ }, "variance": null } - ] + ], + "exact": false } } - ] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/6/expected.json b/test/fixtures/flow/interfaces-module-and-script/6/expected.json index e2c90567fb..bb54189558 100644 --- a/test/fixtures/flow/interfaces-module-and-script/6/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/6/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "Bar" }, "name": "Bar" }, @@ -110,7 +112,7 @@ "body": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/7/expected.json b/test/fixtures/flow/interfaces-module-and-script/7/expected.json index edfbf9f89b..faeb81e32f 100644 --- a/test/fixtures/flow/interfaces-module-and-script/7/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/7/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -70,7 +71,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "Bar" }, "name": "Bar" }, @@ -101,7 +103,8 @@ "end": { "line": 1, "column": 36 - } + }, + "identifierName": "Bat" }, "name": "Bat" }, @@ -133,7 +136,8 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "Man" }, "name": "Man" }, @@ -188,7 +192,7 @@ "body": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/8/expected.json b/test/fixtures/flow/interfaces-module-and-script/8/expected.json index 64e39ba8ff..c06be5f984 100644 --- a/test/fixtures/flow/interfaces-module-and-script/8/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/8/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "Bar" }, "name": "Bar" }, @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 42 - } + }, + "identifierName": "Bat" }, "name": "Bat" }, @@ -157,7 +160,7 @@ "body": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/interfaces-module-and-script/9/expected.json b/test/fixtures/flow/interfaces-module-and-script/9/expected.json index d68a71a9c4..25a172c9ca 100644 --- a/test/fixtures/flow/interfaces-module-and-script/9/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/9/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -84,7 +85,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "Bar" }, "name": "Bar" }, @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 42 - } + }, + "identifierName": "Bat" }, "name": "Bat" }, @@ -167,7 +170,8 @@ "end": { "line": 1, "column": 60 - } + }, + "identifierName": "Man" }, "name": "Man" }, @@ -191,7 +195,7 @@ "body": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/literal-types/boolean-false/expected.json b/test/fixtures/flow/literal-types/boolean-false/expected.json index 6cc01d01a9..7b3dbda941 100644 --- a/test/fixtures/flow/literal-types/boolean-false/expected.json +++ b/test/fixtures/flow/literal-types/boolean-false/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo", "typeAnnotation": { @@ -109,6 +110,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/flow/literal-types/boolean-true/expected.json b/test/fixtures/flow/literal-types/boolean-true/expected.json index b05db87966..74fbf09ae1 100644 --- a/test/fixtures/flow/literal-types/boolean-true/expected.json +++ b/test/fixtures/flow/literal-types/boolean-true/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "foo" }, "name": "foo", "typeAnnotation": { @@ -109,6 +110,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/flow/literal-types/null/expected.json b/test/fixtures/flow/literal-types/null/expected.json index 78ebec7ba0..9eefed3e90 100644 --- a/test/fixtures/flow/literal-types/null/expected.json +++ b/test/fixtures/flow/literal-types/null/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "foo" }, "name": "foo", "typeAnnotation": { @@ -109,6 +110,7 @@ ], "kind": "var" } - ] + ], + "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/literal-types/number-binary/expected.json b/test/fixtures/flow/literal-types/number-binary/expected.json index 2f0fde7e23..0490f1092c 100644 --- a/test/fixtures/flow/literal-types/number-binary/expected.json +++ b/test/fixtures/flow/literal-types/number-binary/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -100,11 +101,11 @@ "column": 16 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "0b1111011" - } + }, + "value": 123 } } }, diff --git a/test/fixtures/flow/literal-types/number-float/expected.json b/test/fixtures/flow/literal-types/number-float/expected.json index 3b07b2d152..2ef1aa9f66 100644 --- a/test/fixtures/flow/literal-types/number-float/expected.json +++ b/test/fixtures/flow/literal-types/number-float/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -100,11 +101,11 @@ "column": 12 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "123.0" - } + }, + "value": 123 } } }, diff --git a/test/fixtures/flow/literal-types/number-integer/expected.json b/test/fixtures/flow/literal-types/number-integer/expected.json index dd2263c75e..009266cb9a 100644 --- a/test/fixtures/flow/literal-types/number-integer/expected.json +++ b/test/fixtures/flow/literal-types/number-integer/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -100,11 +101,11 @@ "column": 10 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "123" - } + }, + "value": 123 } } }, diff --git a/test/fixtures/flow/literal-types/number-negative-binary/expected.json b/test/fixtures/flow/literal-types/number-negative-binary/expected.json index b2e1b30e2b..d0e43e2b7c 100644 --- a/test/fixtures/flow/literal-types/number-negative-binary/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-binary/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -100,11 +101,11 @@ "column": 17 } }, - "value": -123, "extra": { "rawValue": -123, "raw": "-0b1111011" - } + }, + "value": -123 } } }, @@ -116,4 +117,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/literal-types/number-negative-float/expected.json b/test/fixtures/flow/literal-types/number-negative-float/expected.json index 512bb96995..e1f7c14aba 100644 --- a/test/fixtures/flow/literal-types/number-negative-float/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-float/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -100,11 +101,11 @@ "column": 13 } }, - "value": -123, "extra": { "rawValue": -123, "raw": "-123.0" - } + }, + "value": -123 } } }, @@ -116,4 +117,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/literal-types/number-negative-octal-2/expected.json b/test/fixtures/flow/literal-types/number-negative-octal-2/expected.json index 55f18f5552..b694f2aff6 100644 --- a/test/fixtures/flow/literal-types/number-negative-octal-2/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-octal-2/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -100,11 +101,11 @@ "column": 13 } }, - "value": -123, "extra": { "rawValue": -123, "raw": "-0o173" - } + }, + "value": -123 } } }, @@ -116,4 +117,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/literal-types/number-negative-octal/expected.json b/test/fixtures/flow/literal-types/number-negative-octal/expected.json index 2bb4e02623..9b95a16a64 100644 --- a/test/fixtures/flow/literal-types/number-negative-octal/expected.json +++ b/test/fixtures/flow/literal-types/number-negative-octal/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -100,11 +101,11 @@ "column": 12 } }, - "value": -123, "extra": { "rawValue": -123, "raw": "-0x7B" - } + }, + "value": -123 } } }, @@ -116,4 +117,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/literal-types/number-octal-2/expected.json b/test/fixtures/flow/literal-types/number-octal-2/expected.json index f57f036c6e..4da3b6ff0c 100644 --- a/test/fixtures/flow/literal-types/number-octal-2/expected.json +++ b/test/fixtures/flow/literal-types/number-octal-2/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -100,11 +101,11 @@ "column": 12 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "0o173" - } + }, + "value": 123 } } }, diff --git a/test/fixtures/flow/literal-types/number-octal/expected.json b/test/fixtures/flow/literal-types/number-octal/expected.json index bd69b4d140..ecb707cc9a 100644 --- a/test/fixtures/flow/literal-types/number-octal/expected.json +++ b/test/fixtures/flow/literal-types/number-octal/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -100,11 +101,11 @@ "column": 11 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "0x7B" - } + }, + "value": 123 } } }, diff --git a/test/fixtures/flow/literal-types/string-double/expected.json b/test/fixtures/flow/literal-types/string-double/expected.json index 75c50aa13a..7ced64b71c 100644 --- a/test/fixtures/flow/literal-types/string-double/expected.json +++ b/test/fixtures/flow/literal-types/string-double/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "createElement" }, "name": "createElement" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "tagName" }, "name": "tagName", "typeAnnotation": { @@ -104,11 +107,11 @@ "column": 37 } }, - "value": "div", "extra": { "rawValue": "div", "raw": "\"div\"" - } + }, + "value": "div" } } } @@ -154,11 +157,13 @@ "end": { "line": 1, "column": 54 - } + }, + "identifierName": "HTMLDivElement" }, "name": "HTMLDivElement" } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/literal-types/string-single/expected.json b/test/fixtures/flow/literal-types/string-single/expected.json index e168fb2f91..c968bebd4b 100644 --- a/test/fixtures/flow/literal-types/string-single/expected.json +++ b/test/fixtures/flow/literal-types/string-single/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "createElement" }, "name": "createElement" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "tagName" }, "name": "tagName", "typeAnnotation": { @@ -104,11 +107,11 @@ "column": 37 } }, - "value": "div", "extra": { "rawValue": "div", "raw": "'div'" - } + }, + "value": "div" } } } @@ -154,11 +157,13 @@ "end": { "line": 1, "column": 54 - } + }, + "identifierName": "HTMLDivElement" }, "name": "HTMLDivElement" } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/optional-type/1/expected.json b/test/fixtures/flow/optional-type/1/expected.json index 14de301f7b..da459cf18d 100644 --- a/test/fixtures/flow/optional-type/1/expected.json +++ b/test/fixtures/flow/optional-type/1/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x", "optional": true diff --git a/test/fixtures/flow/optional-type/3/expected.json b/test/fixtures/flow/optional-type/3/expected.json index 4958cf281a..338ba4dbb9 100644 --- a/test/fixtures/flow/optional-type/3/expected.json +++ b/test/fixtures/flow/optional-type/3/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x", "optional": true @@ -135,7 +137,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "y" }, "name": "y", "optional": true, @@ -180,7 +183,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "Object" }, "name": "Object" } diff --git a/test/fixtures/flow/optional-type/4/expected.json b/test/fixtures/flow/optional-type/4/expected.json index a570eafd13..8a9c1e5b99 100644 --- a/test/fixtures/flow/optional-type/4/expected.json +++ b/test/fixtures/flow/optional-type/4/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -118,7 +119,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/flow/predicates/1/expected.json b/test/fixtures/flow/predicates/1/expected.json index eb81514fc4..0c21887783 100644 --- a/test/fixtures/flow/predicates/1/expected.json +++ b/test/fixtures/flow/predicates/1/expected.json @@ -223,4 +223,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/predicates/2/expected.json b/test/fixtures/flow/predicates/2/expected.json index 64df4c2006..fb45d0dad1 100644 --- a/test/fixtures/flow/predicates/2/expected.json +++ b/test/fixtures/flow/predicates/2/expected.json @@ -253,4 +253,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/predicates/3/expected.json b/test/fixtures/flow/predicates/3/expected.json index 8553cc335f..8bdfbef015 100644 --- a/test/fixtures/flow/predicates/3/expected.json +++ b/test/fixtures/flow/predicates/3/expected.json @@ -267,4 +267,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/predicates/6/expected.json b/test/fixtures/flow/predicates/6/expected.json index b4dc60f2be..2916a3cf54 100644 --- a/test/fixtures/flow/predicates/6/expected.json +++ b/test/fixtures/flow/predicates/6/expected.json @@ -191,11 +191,11 @@ "column": 40 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 } ] }, @@ -543,11 +543,11 @@ "column": 83 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 } ] }, @@ -589,11 +589,12 @@ "name": "Array" } } - } + }, + "predicate": null } } } ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/qualified-generic-type/1/expected.json b/test/fixtures/flow/qualified-generic-type/1/expected.json index 74c8b20f8e..073d4776b7 100644 --- a/test/fixtures/flow/qualified-generic-type/1/expected.json +++ b/test/fixtures/flow/qualified-generic-type/1/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -127,7 +128,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -143,7 +145,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "B" }, "name": "B" } @@ -156,7 +159,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/qualified-generic-type/2/expected.json b/test/fixtures/flow/qualified-generic-type/2/expected.json index 56ec96bee3..511e2495e0 100644 --- a/test/fixtures/flow/qualified-generic-type/2/expected.json +++ b/test/fixtures/flow/qualified-generic-type/2/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -141,7 +142,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -157,7 +159,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "B" }, "name": "B" } @@ -174,7 +177,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "C" }, "name": "C" } @@ -187,7 +191,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/qualified-generic-type/3/expected.json b/test/fixtures/flow/qualified-generic-type/3/expected.json index 5cd3ae50df..aba60b3aeb 100644 --- a/test/fixtures/flow/qualified-generic-type/3/expected.json +++ b/test/fixtures/flow/qualified-generic-type/3/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -142,7 +143,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "T" }, "name": "T" } @@ -175,7 +177,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -191,7 +194,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "B" }, "name": "B" } @@ -204,7 +208,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/qualified-generic-type/4/expected.json b/test/fixtures/flow/qualified-generic-type/4/expected.json index 4a826a0f2a..5fd9813013 100644 --- a/test/fixtures/flow/qualified-generic-type/4/expected.json +++ b/test/fixtures/flow/qualified-generic-type/4/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -156,7 +157,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "T" }, "name": "T" } @@ -189,7 +191,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "A" }, "name": "A" }, @@ -205,7 +208,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "B" }, "name": "B" } @@ -219,7 +223,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json b/test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json deleted file mode 100644 index 4fba0bba88..0000000000 --- a/test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "sourceType": "module", - "body": [ - { - "type": "VariableDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "declarations": [ - { - "type": "VariableDeclarator", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "id": { - "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "name": "foo" - }, - "init": { - "type": "ArrowFunctionExpression", - "start": 10, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [ - { - "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "name": "foo", - "parenthesizedExpression": true - } - ], - "body": { - "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "body": [] - }, - "returnType": { - "type": "TypeAnnotation", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 25 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } - } - } - } - } - ], - "kind": "var" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/flow/regression/issue-2083/expected.json b/test/fixtures/flow/regression/issue-2083/expected.json index 9b59a8861e..ff7b01c2f5 100644 --- a/test/fixtures/flow/regression/issue-2083/expected.json +++ b/test/fixtures/flow/regression/issue-2083/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 3 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "foo" }, "name": "foo" }, - "static": false, "kind": "method", "id": null, "generator": false, @@ -217,7 +219,8 @@ "end": { "line": 4, "column": 22 - } + }, + "identifierName": "MatrixType" }, "name": "MatrixType" }, @@ -233,7 +236,8 @@ "end": { "line": 4, "column": 32 - } + }, + "identifierName": "IsScaling" }, "name": "IsScaling" }, @@ -266,7 +270,8 @@ "end": { "line": 4, "column": 45 - } + }, + "identifierName": "MatrixType" }, "name": "MatrixType" }, @@ -282,14 +287,16 @@ "end": { "line": 4, "column": 59 - } + }, + "identifierName": "IsTranslation" }, "name": "IsTranslation" }, "computed": false }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 50 } } } @@ -313,6 +320,7 @@ "column": 3 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -326,11 +334,11 @@ "end": { "line": 8, "column": 5 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": false, "kind": "method", "id": null, "generator": false, @@ -406,7 +414,8 @@ "end": { "line": 9, "column": 18 - } + }, + "identifierName": "typeA" }, "name": "typeA" }, @@ -432,7 +441,8 @@ "value": 4 }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 134 } }, "operator": "|", @@ -448,7 +458,8 @@ "end": { "line": 9, "column": 32 - } + }, + "identifierName": "typeB" }, "name": "typeB" } diff --git a/test/fixtures/flow/regression/issue-2493/expected.json b/test/fixtures/flow/regression/issue-2493/expected.json index 7442f6e26f..412bb96edd 100644 --- a/test/fixtures/flow/regression/issue-2493/expected.json +++ b/test/fixtures/flow/regression/issue-2493/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "hello" }, "name": "hello" }, @@ -87,6 +88,37 @@ "column": 1 } }, + "returnType": { + "type": "TypeAnnotation", + "start": 41, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 43, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 49 + } + } + }, + "predicate": null + }, "id": null, "generator": false, "expression": false, @@ -118,7 +150,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "greeting" }, "name": "greeting", "typeAnnotation": { @@ -243,7 +276,8 @@ "end": { "line": 2, "column": 9 - } + }, + "identifierName": "console" }, "name": "console" }, @@ -259,7 +293,8 @@ "end": { "line": 2, "column": 13 - } + }, + "identifierName": "log" }, "name": "log" }, @@ -313,7 +348,8 @@ "end": { "line": 2, "column": 32 - } + }, + "identifierName": "greeting" }, "name": "greeting" } @@ -323,36 +359,6 @@ } ], "directives": [] - }, - "returnType": { - "type": "TypeAnnotation", - "start": 41, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 49 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 49 - } - } - } } } } @@ -399,7 +405,8 @@ "end": { "line": 5, "column": 5 - } + }, + "identifierName": "hello" }, "name": "hello" }, diff --git a/test/fixtures/flow/trailing-function-commas-type/1/expected.json b/test/fixtures/flow/trailing-function-commas-type/1/expected.json index 114d371dff..765744fb3f 100644 --- a/test/fixtures/flow/trailing-function-commas-type/1/expected.json +++ b/test/fixtures/flow/trailing-function-commas-type/1/expected.json @@ -56,6 +56,55 @@ "column": 42 } }, + "returnType": { + "type": "TypeAnnotation", + "start": 21, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 23, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 23, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "ReturnType" + }, + "name": "ReturnType" + } + }, + "predicate": null + }, "id": null, "generator": false, "expression": true, @@ -73,7 +122,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "props" }, "name": "props", "typeAnnotation": { @@ -117,7 +167,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "SomeType" }, "name": "SomeType" } @@ -146,53 +197,6 @@ "parenStart": 37 }, "value": 3 - }, - "returnType": { - "type": "TypeAnnotation", - "start": 21, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - } - }, - "name": "ReturnType" - } - } } } } diff --git a/test/fixtures/flow/tuples/1/expected.json b/test/fixtures/flow/tuples/1/expected.json index a5dd1a823b..7694ca00f1 100644 --- a/test/fixtures/flow/tuples/1/expected.json +++ b/test/fixtures/flow/tuples/1/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -124,7 +125,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/tuples/2/expected.json b/test/fixtures/flow/tuples/2/expected.json index 628e2579d4..6044a8c8d9 100644 --- a/test/fixtures/flow/tuples/2/expected.json +++ b/test/fixtures/flow/tuples/2/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -157,7 +158,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "T" }, "name": "T" } @@ -176,7 +178,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "Foo" }, "name": "Foo" } @@ -212,7 +215,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -222,7 +226,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/tuples/3/expected.json b/test/fixtures/flow/tuples/3/expected.json index 175fca2fdf..a358df13e8 100644 --- a/test/fixtures/flow/tuples/3/expected.json +++ b/test/fixtures/flow/tuples/3/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { diff --git a/test/fixtures/flow/tuples/4/expected.json b/test/fixtures/flow/tuples/4/expected.json index 5a29b26f34..9cd18d0a93 100644 --- a/test/fixtures/flow/tuples/4/expected.json +++ b/test/fixtures/flow/tuples/4/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { diff --git a/test/fixtures/flow/type-alias/1/expected.json b/test/fixtures/flow/type-alias/1/expected.json index a889ed041a..f6591175a3 100644 --- a/test/fixtures/flow/type-alias/1/expected.json +++ b/test/fixtures/flow/type-alias/1/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "FBID" }, "name": "FBID" }, @@ -75,7 +76,7 @@ } } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-alias/2/expected.json b/test/fixtures/flow/type-alias/2/expected.json index f44d030159..974e65eb4d 100644 --- a/test/fixtures/flow/type-alias/2/expected.json +++ b/test/fixtures/flow/type-alias/2/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 8 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -87,7 +88,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -147,7 +149,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "T" }, "name": "T" } @@ -166,7 +169,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "Bar" }, "name": "Bar" } diff --git a/test/fixtures/flow/type-alias/3/expected.json b/test/fixtures/flow/type-alias/3/expected.json index 411a17ad35..cda0b600d3 100644 --- a/test/fixtures/flow/type-alias/3/expected.json +++ b/test/fixtures/flow/type-alias/3/expected.json @@ -42,6 +42,9 @@ "column": 25 } }, + "specifiers": [], + "source": null, + "exportKind": "type", "declaration": { "type": "TypeAlias", "start": 7, @@ -68,7 +71,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,11 +92,9 @@ } } } - }, - "specifiers": [], - "source": null + } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-alias/4/expected.json b/test/fixtures/flow/type-alias/4/expected.json index 829a4048e2..42a84bca7b 100644 --- a/test/fixtures/flow/type-alias/4/expected.json +++ b/test/fixtures/flow/type-alias/4/expected.json @@ -136,11 +136,11 @@ "column": 13 } }, - "value": "A", "extra": { "rawValue": "A", "raw": "\"A\"" - } + }, + "value": "A" }, "optional": false, "static": false, @@ -211,11 +211,11 @@ "column": 13 } }, - "value": "B", "extra": { "rawValue": "B", "raw": "\"B\"" - } + }, + "value": "B" }, "optional": false, "static": false, @@ -597,11 +597,11 @@ "column": 16 } }, - "value": "A", "extra": { "rawValue": "A", "raw": "\"A\"" - } + }, + "value": "A" }, "optional": false, "static": false, @@ -672,11 +672,11 @@ "column": 16 } }, - "value": "B", "extra": { "rawValue": "B", "raw": "\"B\"" - } + }, + "value": "B" }, "optional": false, "static": false, @@ -852,11 +852,11 @@ "column": 16 } }, - "value": "A", "extra": { "rawValue": "A", "raw": "\"A\"" - } + }, + "value": "A" }, "optional": false, "static": false, @@ -927,11 +927,11 @@ "column": 16 } }, - "value": "B", "extra": { "rawValue": "B", "raw": "\"B\"" - } + }, + "value": "B" }, "optional": false, "static": false, diff --git a/test/fixtures/flow/type-annotations/1/expected.json b/test/fixtures/flow/type-annotations/1/expected.json index 4d022b66ad..ae49055627 100644 --- a/test/fixtures/flow/type-annotations/1/expected.json +++ b/test/fixtures/flow/type-annotations/1/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "numVal" }, "name": "numVal", "typeAnnotation": { @@ -119,7 +122,8 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "otherVal" }, "name": "otherVal", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/10/expected.json b/test/fixtures/flow/type-annotations/10/expected.json index 6aae036622..9e46f1b9bf 100644 --- a/test/fixtures/flow/type-annotations/10/expected.json +++ b/test/fixtures/flow/type-annotations/10/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 53 - } + }, + "identifierName": "callback" }, "name": "callback", "typeAnnotation": { @@ -131,7 +134,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "_1" }, "name": "_1" }, @@ -178,7 +182,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "_2" }, "name": "_2" }, diff --git a/test/fixtures/flow/type-annotations/100/expected.json b/test/fixtures/flow/type-annotations/100/expected.json index 5efdb76d0e..41ea4f70df 100644 --- a/test/fixtures/flow/type-annotations/100/expected.json +++ b/test/fixtures/flow/type-annotations/100/expected.json @@ -1,4 +1,3 @@ - { "type": "File", "start": 0, @@ -55,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -89,6 +89,7 @@ "column": 39 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -102,99 +103,102 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": false, "kind": "method", "id": null, - "generator": false, - "expression": false, - "async": false, - "params": [], - "returnType": { - "type": "TypeAnnotation", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "typeAnnotation": { - "type": "ThisTypeAnnotation", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - }, - "body": { - "type": "BlockStatement", - "start": 23, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 39 - } - }, - "body": [ - { - "type": "ReturnStatement", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 37 - } - }, - "argument": { - "type": "ThisExpression", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - } - } - } - } - ] - } + "generator": false, + "expression": false, + "async": false, + "params": [], + "returnType": { + "type": "TypeAnnotation", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "typeAnnotation": { + "type": "ThisTypeAnnotation", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": true + }, + "predicate": null + }, + "body": { + "type": "BlockStatement", + "start": 23, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 25, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "argument": { + "type": "ThisExpression", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 36 + } + } + } + } + ], + "directives": [] + } } ] } } - ] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/101/expected.json b/test/fixtures/flow/type-annotations/101/expected.json index ae370710de..dd76a3f6b4 100644 --- a/test/fixtures/flow/type-annotations/101/expected.json +++ b/test/fixtures/flow/type-annotations/101/expected.json @@ -111,12 +111,14 @@ "end": { "line": 1, "column": 36 - } + }, + "identifierName": "ReturnType" }, "name": "ReturnType" } } - } + }, + "predicate": null }, "id": null, "generator": false, @@ -149,7 +151,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "props" }, "name": "props" }, @@ -194,7 +197,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "SomeType" }, "name": "SomeType" } @@ -229,4 +233,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/102/expected.json b/test/fixtures/flow/type-annotations/102/expected.json index 4af93bb673..c03c26b03d 100644 --- a/test/fixtures/flow/type-annotations/102/expected.json +++ b/test/fixtures/flow/type-annotations/102/expected.json @@ -128,11 +128,13 @@ "end": { "line": 1, "column": 36 - } + }, + "identifierName": "Array" }, "name": "Array" } - } + }, + "predicate": null }, "id": null, "generator": false, @@ -165,7 +167,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "modifiers" }, "name": "modifiers" } @@ -193,4 +196,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/103/expected.json b/test/fixtures/flow/type-annotations/103/expected.json index 0ef3fc5e61..9824789642 100644 --- a/test/fixtures/flow/type-annotations/103/expected.json +++ b/test/fixtures/flow/type-annotations/103/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "parser" }, "name": "parser" }, @@ -128,11 +129,13 @@ "end": { "line": 1, "column": 67 - } + }, + "identifierName": "a" }, "name": "a" } - } + }, + "predicate": null }, "id": null, "generator": false, @@ -151,7 +154,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "rootPath" }, "name": "rootPath", "typeAnnotation": { @@ -211,7 +215,8 @@ "end": { "line": 1, "column": 49 - } + }, + "identifierName": "filesToParse" }, "name": "filesToParse" }, @@ -287,7 +292,8 @@ "end": { "line": 1, "column": 56 - } + }, + "identifierName": "Array" }, "name": "Array" } diff --git a/test/fixtures/flow/type-annotations/104/expected.json b/test/fixtures/flow/type-annotations/104/expected.json index d1bef6ae76..6ff300d7c7 100644 --- a/test/fixtures/flow/type-annotations/104/expected.json +++ b/test/fixtures/flow/type-annotations/104/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 13 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "get" }, "name": "get" }, - "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -136,7 +138,8 @@ "column": 7 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -192,7 +195,8 @@ "end": { "line": 5, "column": 9 - } + }, + "identifierName": "Bar" }, "name": "Bar" }, @@ -226,6 +230,7 @@ "column": 13 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -239,11 +244,11 @@ "end": { "line": 6, "column": 5 - } + }, + "identifierName": "set" }, "name": "set" }, - "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -274,7 +279,8 @@ "column": 7 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -307,4 +313,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/107/expected.json b/test/fixtures/flow/type-annotations/107/expected.json index b17400628a..9f972ee738 100644 --- a/test/fixtures/flow/type-annotations/107/expected.json +++ b/test/fixtures/flow/type-annotations/107/expected.json @@ -256,4 +256,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/108/expected.json b/test/fixtures/flow/type-annotations/108/expected.json index 4d147cf4f4..ae2c71d275 100644 --- a/test/fixtures/flow/type-annotations/108/expected.json +++ b/test/fixtures/flow/type-annotations/108/expected.json @@ -150,6 +150,7 @@ } }, "optional": false, + "static": false, "variance": null }, { @@ -199,6 +200,7 @@ } }, "optional": false, + "static": false, "variance": null } ], @@ -460,6 +462,7 @@ } }, "optional": false, + "static": false, "variance": null }, { @@ -509,6 +512,7 @@ } }, "optional": false, + "static": false, "variance": null } ], @@ -917,6 +921,7 @@ } }, "optional": false, + "static": false, "variance": null }, { @@ -966,6 +971,7 @@ } }, "optional": false, + "static": false, "variance": null } ], @@ -973,6 +979,7 @@ "exact": true }, "optional": false, + "static": false, "variance": null }, { @@ -1022,6 +1029,7 @@ } }, "optional": false, + "static": false, "variance": null } ], @@ -1433,6 +1441,7 @@ } }, "optional": false, + "static": false, "variance": null }, { @@ -1482,6 +1491,7 @@ } }, "optional": false, + "static": false, "variance": null } ], @@ -1489,6 +1499,7 @@ "exact": false }, "optional": false, + "static": false, "variance": null }, { @@ -1538,6 +1549,7 @@ } }, "optional": false, + "static": false, "variance": null } ], diff --git a/test/fixtures/flow/type-annotations/11/expected.json b/test/fixtures/flow/type-annotations/11/expected.json index 5de62117eb..10d10e3696 100644 --- a/test/fixtures/flow/type-annotations/11/expected.json +++ b/test/fixtures/flow/type-annotations/11/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 64 - } + }, + "identifierName": "callback" }, "name": "callback", "typeAnnotation": { @@ -131,7 +134,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "_1" }, "name": "_1" }, @@ -179,7 +183,8 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -242,7 +247,8 @@ "end": { "line": 1, "column": 45 - } + }, + "identifierName": "Array" }, "name": "Array" } diff --git a/test/fixtures/flow/type-annotations/110/expected.json b/test/fixtures/flow/type-annotations/110/expected.json index 813e1eb0d2..f637eb85b6 100644 --- a/test/fixtures/flow/type-annotations/110/expected.json +++ b/test/fixtures/flow/type-annotations/110/expected.json @@ -167,4 +167,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/111/expected.json b/test/fixtures/flow/type-annotations/111/expected.json index e8d4f2f2c1..088ac9c758 100644 --- a/test/fixtures/flow/type-annotations/111/expected.json +++ b/test/fixtures/flow/type-annotations/111/expected.json @@ -167,4 +167,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/114/expected.json b/test/fixtures/flow/type-annotations/114/expected.json index 4a29dfbbee..5cbe3ec43a 100644 --- a/test/fixtures/flow/type-annotations/114/expected.json +++ b/test/fixtures/flow/type-annotations/114/expected.json @@ -199,4 +199,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/115/expected.json b/test/fixtures/flow/type-annotations/115/expected.json index 7868c1e169..cdb32af1e6 100644 --- a/test/fixtures/flow/type-annotations/115/expected.json +++ b/test/fixtures/flow/type-annotations/115/expected.json @@ -199,4 +199,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/118/expected.json b/test/fixtures/flow/type-annotations/118/expected.json index 6b123d102a..86dba55ab3 100644 --- a/test/fixtures/flow/type-annotations/118/expected.json +++ b/test/fixtures/flow/type-annotations/118/expected.json @@ -89,6 +89,7 @@ "column": 13 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -123,7 +124,6 @@ }, "kind": "plus" }, - "static": false, "typeAnnotation": { "type": "TypeAnnotation", "start": 11, diff --git a/test/fixtures/flow/type-annotations/119/expected.json b/test/fixtures/flow/type-annotations/119/expected.json index 3fb9fb001a..b975624266 100644 --- a/test/fixtures/flow/type-annotations/119/expected.json +++ b/test/fixtures/flow/type-annotations/119/expected.json @@ -89,6 +89,7 @@ "column": 13 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -123,7 +124,6 @@ }, "kind": "minus" }, - "static": false, "typeAnnotation": { "type": "TypeAnnotation", "start": 11, diff --git a/test/fixtures/flow/type-annotations/12/expected.json b/test/fixtures/flow/type-annotations/12/expected.json index fddf075029..9b0105cae1 100644 --- a/test/fixtures/flow/type-annotations/12/expected.json +++ b/test/fixtures/flow/type-annotations/12/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], "returnType": { "type": "TypeAnnotation", @@ -89,7 +91,8 @@ "column": 21 } } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/129/expected.json b/test/fixtures/flow/type-annotations/129/expected.json index d5fd461dfe..ecffbbf855 100644 --- a/test/fixtures/flow/type-annotations/129/expected.json +++ b/test/fixtures/flow/type-annotations/129/expected.json @@ -116,11 +116,11 @@ "column": 4 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 }, { "type": "NumberLiteralTypeAnnotation", @@ -136,11 +136,11 @@ "column": 4 } }, - "value": 2, "extra": { "rawValue": 2, "raw": "2" - } + }, + "value": 2 } ] } diff --git a/test/fixtures/flow/type-annotations/13/expected.json b/test/fixtures/flow/type-annotations/13/expected.json index 1070cfbe37..4e216e438a 100644 --- a/test/fixtures/flow/type-annotations/13/expected.json +++ b/test/fixtures/flow/type-annotations/13/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], "returnType": { "type": "TypeAnnotation", @@ -107,7 +109,8 @@ } }, "typeParameters": null - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/130/expected.json b/test/fixtures/flow/type-annotations/130/expected.json index 26a0c561a6..04fcde6a9b 100644 --- a/test/fixtures/flow/type-annotations/130/expected.json +++ b/test/fixtures/flow/type-annotations/130/expected.json @@ -122,11 +122,11 @@ "column": 17 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 }, { "type": "NumberLiteralTypeAnnotation", @@ -142,11 +142,11 @@ "column": 21 } }, - "value": 2, "extra": { "rawValue": 2, "raw": "2" - } + }, + "value": 2 } ] } @@ -211,11 +211,11 @@ "column": 29 } }, - "value": 3, "extra": { "rawValue": 3, "raw": "3" - } + }, + "value": 3 }, { "type": "NumberLiteralTypeAnnotation", @@ -231,11 +231,11 @@ "column": 33 } }, - "value": 4, "extra": { "rawValue": 4, "raw": "4" - } + }, + "value": 4 } ] } @@ -270,7 +270,8 @@ "column": 42 } } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/14/expected.json b/test/fixtures/flow/type-annotations/14/expected.json index 96fb6480b2..df8525c0d6 100644 --- a/test/fixtures/flow/type-annotations/14/expected.json +++ b/test/fixtures/flow/type-annotations/14/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], "returnType": { "type": "TypeAnnotation", @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "_" }, "name": "_" }, @@ -155,7 +158,8 @@ } }, "typeParameters": null - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/15/expected.json b/test/fixtures/flow/type-annotations/15/expected.json index 310bd0ca0c..a6da914974 100644 --- a/test/fixtures/flow/type-annotations/15/expected.json +++ b/test/fixtures/flow/type-annotations/15/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], "returnType": { "type": "TypeAnnotation", @@ -116,7 +118,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "_" }, "name": "_" }, @@ -155,7 +158,8 @@ } }, "typeParameters": null - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/16/expected.json b/test/fixtures/flow/type-annotations/16/expected.json index 392f618655..3f39468f6a 100644 --- a/test/fixtures/flow/type-annotations/16/expected.json +++ b/test/fixtures/flow/type-annotations/16/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], "returnType": { "type": "TypeAnnotation", @@ -91,8 +93,10 @@ }, "callProperties": [], "properties": [], - "indexers": [] - } + "indexers": [], + "exact": false + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/17/expected.json b/test/fixtures/flow/type-annotations/17/expected.json index 79b5a0eac8..ca24d0c90a 100644 --- a/test/fixtures/flow/type-annotations/17/expected.json +++ b/test/fixtures/flow/type-annotations/17/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -90,7 +91,8 @@ "column": 14 } }, - "name": "T" + "name": "T", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-annotations/18/expected.json b/test/fixtures/flow/type-annotations/18/expected.json index 914cf6d4a7..56d24c9789 100644 --- a/test/fixtures/flow/type-annotations/18/expected.json +++ b/test/fixtures/flow/type-annotations/18/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -90,7 +91,8 @@ "column": 14 } }, - "name": "T" + "name": "T", + "variance": null }, { "type": "TypeParameter", @@ -106,7 +108,8 @@ "column": 16 } }, - "name": "S" + "name": "S", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-annotations/19/expected.json b/test/fixtures/flow/type-annotations/19/expected.json index efca68b2de..6155d2e0f5 100644 --- a/test/fixtures/flow/type-annotations/19/expected.json +++ b/test/fixtures/flow/type-annotations/19/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -120,7 +121,8 @@ "column": 12 } }, - "name": "T" + "name": "T", + "variance": null }, { "type": "TypeParameter", @@ -136,7 +138,8 @@ "column": 14 } }, - "name": "S" + "name": "S", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-annotations/2/expected.json b/test/fixtures/flow/type-annotations/2/expected.json index 9f0c84fa45..39c2e55c4f 100644 --- a/test/fixtures/flow/type-annotations/2/expected.json +++ b/test/fixtures/flow/type-annotations/2/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "numVal" }, "name": "numVal", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/20/expected.json b/test/fixtures/flow/type-annotations/20/expected.json index e21b48d766..cf418c1dd4 100644 --- a/test/fixtures/flow/type-annotations/20/expected.json +++ b/test/fixtures/flow/type-annotations/20/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,11 +118,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "fooProp" }, "name": "fooProp" }, "kind": "set", + "variance": null, "id": null, "generator": false, "expression": false, @@ -139,7 +142,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "value" }, "name": "value", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/21/expected.json b/test/fixtures/flow/type-annotations/21/expected.json index d1ddc78e40..9a7b0f628b 100644 --- a/test/fixtures/flow/type-annotations/21/expected.json +++ b/test/fixtures/flow/type-annotations/21/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,11 +118,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "fooProp" }, "name": "fooProp" }, "kind": "set", + "variance": null, "id": null, "generator": false, "expression": false, @@ -139,7 +142,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "value" }, "name": "value", "typeAnnotation": { @@ -202,7 +206,8 @@ "column": 33 } } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/22/expected.json b/test/fixtures/flow/type-annotations/22/expected.json index 4725285737..f851043cf5 100644 --- a/test/fixtures/flow/type-annotations/22/expected.json +++ b/test/fixtures/flow/type-annotations/22/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,11 +118,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "fooProp" }, "name": "fooProp" }, "kind": "get", + "variance": null, "id": null, "generator": false, "expression": false, @@ -155,7 +158,8 @@ "column": 23 } } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/23/expected.json b/test/fixtures/flow/type-annotations/23/expected.json index 3cb0c90897..26289cb8bf 100644 --- a/test/fixtures/flow/type-annotations/23/expected.json +++ b/test/fixtures/flow/type-annotations/23/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "id" }, "name": "id" }, @@ -139,7 +141,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -183,7 +186,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "T" }, "name": "T" } @@ -232,11 +236,13 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "T" }, "name": "T" } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", @@ -284,7 +290,8 @@ "column": 7 } }, - "name": "T" + "name": "T", + "variance": null } ] } diff --git a/test/fixtures/flow/type-annotations/24/expected.json b/test/fixtures/flow/type-annotations/24/expected.json index 8d2e85d6c2..cb9a6c5fbc 100644 --- a/test/fixtures/flow/type-annotations/24/expected.json +++ b/test/fixtures/flow/type-annotations/24/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "id" }, "name": "id" }, @@ -139,7 +141,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -183,7 +186,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "T" }, "name": "T" } @@ -232,11 +236,13 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "T" }, "name": "T" } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", @@ -284,7 +290,8 @@ "column": 8 } }, - "name": "T" + "name": "T", + "variance": null } ] } diff --git a/test/fixtures/flow/type-annotations/25/expected.json b/test/fixtures/flow/type-annotations/25/expected.json index cc26713d44..b5e58e017c 100644 --- a/test/fixtures/flow/type-annotations/25/expected.json +++ b/test/fixtures/flow/type-annotations/25/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -117,7 +118,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "id" }, "name": "id" }, @@ -139,7 +141,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -183,7 +186,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "T" }, "name": "T" } @@ -232,11 +236,13 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "T" }, "name": "T" } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", @@ -284,7 +290,8 @@ "column": 13 } }, - "name": "T" + "name": "T", + "variance": null } ] } diff --git a/test/fixtures/flow/type-annotations/26/expected.json b/test/fixtures/flow/type-annotations/26/expected.json index 0507d3b4dc..e2c02a54a5 100644 --- a/test/fixtures/flow/type-annotations/26/expected.json +++ b/test/fixtures/flow/type-annotations/26/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -143,7 +144,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -187,7 +189,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "T" }, "name": "T" } @@ -236,11 +239,13 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "T" }, "name": "T" } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", @@ -288,7 +293,8 @@ "column": 8 } }, - "name": "T" + "name": "T", + "variance": null } ] } diff --git a/test/fixtures/flow/type-annotations/27/expected.json b/test/fixtures/flow/type-annotations/27/expected.json index 71c96e968a..07d8b8fd2d 100644 --- a/test/fixtures/flow/type-annotations/27/expected.json +++ b/test/fixtures/flow/type-annotations/27/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 38 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "fooProp" }, "name": "fooProp" }, - "static": false, "kind": "set", "id": null, "generator": false, @@ -124,7 +126,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "value" }, "name": "value", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/28/expected.json b/test/fixtures/flow/type-annotations/28/expected.json index ba9b916990..b5c04ffc8d 100644 --- a/test/fixtures/flow/type-annotations/28/expected.json +++ b/test/fixtures/flow/type-annotations/28/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 43 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "fooProp" }, "name": "fooProp" }, - "static": false, "kind": "set", "id": null, "generator": false, @@ -124,7 +126,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "value" }, "name": "value", "typeAnnotation": { @@ -187,7 +190,8 @@ "column": 41 } } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/29/expected.json b/test/fixtures/flow/type-annotations/29/expected.json index b675422aca..1f35974d10 100644 --- a/test/fixtures/flow/type-annotations/29/expected.json +++ b/test/fixtures/flow/type-annotations/29/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 33 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "fooProp" }, "name": "fooProp" }, - "static": false, "kind": "get", "id": null, "generator": false, @@ -140,7 +142,8 @@ "column": 31 } } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/3/expected.json b/test/fixtures/flow/type-annotations/3/expected.json index 6c069ca9dd..ad0533f545 100644 --- a/test/fixtures/flow/type-annotations/3/expected.json +++ b/test/fixtures/flow/type-annotations/3/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "numVal" }, "name": "numVal", "typeAnnotation": { @@ -119,7 +122,8 @@ "end": { "line": 1, "column": 43 - } + }, + "identifierName": "strVal" }, "name": "strVal", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/30/expected.json b/test/fixtures/flow/type-annotations/30/expected.json index f2d9219592..3bf70055fa 100644 --- a/test/fixtures/flow/type-annotations/30/expected.json +++ b/test/fixtures/flow/type-annotations/30/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "numVal" }, "name": "numVal", "typeAnnotation": { @@ -108,7 +109,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/31/expected.json b/test/fixtures/flow/type-annotations/31/expected.json index c885a0e4d9..654148cf75 100644 --- a/test/fixtures/flow/type-annotations/31/expected.json +++ b/test/fixtures/flow/type-annotations/31/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "numVal" }, "name": "numVal", "typeAnnotation": { @@ -115,7 +116,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "otherNumVal" }, "name": "otherNumVal" } @@ -123,7 +125,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/32/expected.json b/test/fixtures/flow/type-annotations/32/expected.json index 272d0ef394..ce82a0dbf1 100644 --- a/test/fixtures/flow/type-annotations/32/expected.json +++ b/test/fixtures/flow/type-annotations/32/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -128,7 +129,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "numVal" }, "name": "numVal" }, @@ -148,10 +150,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -160,7 +164,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/33/expected.json b/test/fixtures/flow/type-annotations/33/expected.json index 0debe1f0b4..9c2bc6c2da 100644 --- a/test/fixtures/flow/type-annotations/33/expected.json +++ b/test/fixtures/flow/type-annotations/33/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -128,7 +129,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "numVal" }, "name": "numVal" }, @@ -148,10 +150,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -160,7 +164,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/34/expected.json b/test/fixtures/flow/type-annotations/34/expected.json index dda3fa64e2..a9ca235616 100644 --- a/test/fixtures/flow/type-annotations/34/expected.json +++ b/test/fixtures/flow/type-annotations/34/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 50 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -128,7 +129,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "numVal" }, "name": "numVal" }, @@ -148,6 +150,7 @@ } }, "optional": false, + "static": false, "variance": null } ], @@ -166,6 +169,7 @@ "column": 49 } }, + "static": false, "id": { "type": "Identifier", "start": 25, @@ -178,7 +182,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "indexer" }, "name": "indexer" }, @@ -214,7 +219,8 @@ }, "variance": null } - ] + ], + "exact": false } } }, @@ -223,7 +229,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/35/expected.json b/test/fixtures/flow/type-annotations/35/expected.json index 9b7e857b25..226236359b 100644 --- a/test/fixtures/flow/type-annotations/35/expected.json +++ b/test/fixtures/flow/type-annotations/35/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -142,7 +143,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "numVal" }, "name": "numVal" }, @@ -162,10 +164,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } } @@ -175,7 +179,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/36/expected.json b/test/fixtures/flow/type-annotations/36/expected.json index 564ecad3f2..4ef8af37d3 100644 --- a/test/fixtures/flow/type-annotations/36/expected.json +++ b/test/fixtures/flow/type-annotations/36/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -128,7 +129,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "numVal" }, "name": "numVal" }, @@ -148,6 +150,7 @@ } }, "optional": false, + "static": false, "variance": null }, { @@ -176,7 +179,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "strVal" }, "name": "strVal" }, @@ -196,10 +200,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -208,7 +214,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/37/expected.json b/test/fixtures/flow/type-annotations/37/expected.json index b28c546643..ef13a1423d 100644 --- a/test/fixtures/flow/type-annotations/37/expected.json +++ b/test/fixtures/flow/type-annotations/37/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -128,7 +129,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "subObj" }, "name": "subObj" }, @@ -174,7 +176,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "strVal" }, "name": "strVal" }, @@ -194,16 +197,20 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -212,7 +219,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/38/expected.json b/test/fixtures/flow/type-annotations/38/expected.json index d9a1247969..a37a224c5e 100644 --- a/test/fixtures/flow/type-annotations/38/expected.json +++ b/test/fixtures/flow/type-annotations/38/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -128,7 +129,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "subObj" }, "name": "subObj" }, @@ -188,7 +190,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "strVal" }, "name": "strVal" }, @@ -208,17 +211,21 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -227,7 +234,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/39/expected.json b/test/fixtures/flow/type-annotations/39/expected.json index 4e263242a8..aeb80942b7 100644 --- a/test/fixtures/flow/type-annotations/39/expected.json +++ b/test/fixtures/flow/type-annotations/39/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -128,7 +129,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "param1" }, "name": "param1" }, @@ -148,6 +150,7 @@ } }, "optional": false, + "static": false, "variance": null }, { @@ -176,7 +179,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "param2" }, "name": "param2" }, @@ -196,10 +200,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -208,7 +214,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/4/expected.json b/test/fixtures/flow/type-annotations/4/expected.json index c888bafd92..5535d3d0de 100644 --- a/test/fixtures/flow/type-annotations/4/expected.json +++ b/test/fixtures/flow/type-annotations/4/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "numVal" }, "name": "numVal", "typeAnnotation": { @@ -119,7 +122,8 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "untypedVal" }, "name": "untypedVal" } diff --git a/test/fixtures/flow/type-annotations/40/expected.json b/test/fixtures/flow/type-annotations/40/expected.json index 14d938827c..57f986dc1b 100644 --- a/test/fixtures/flow/type-annotations/40/expected.json +++ b/test/fixtures/flow/type-annotations/40/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -128,7 +129,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "param1" }, "name": "param1" }, @@ -148,6 +150,7 @@ } }, "optional": false, + "static": false, "variance": null }, { @@ -176,7 +179,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "param2" }, "name": "param2" }, @@ -196,10 +200,12 @@ } }, "optional": true, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -208,7 +214,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/41/expected.json b/test/fixtures/flow/type-annotations/41/expected.json index 7db814ba65..af45a70ad3 100644 --- a/test/fixtures/flow/type-annotations/41/expected.json +++ b/test/fixtures/flow/type-annotations/41/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 52 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -117,6 +118,7 @@ "column": 28 } }, + "static": false, "id": { "type": "Identifier", "start": 10, @@ -129,7 +131,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -162,7 +165,8 @@ "column": 28 } } - } + }, + "variance": null }, { "type": "ObjectTypeIndexer", @@ -178,6 +182,7 @@ "column": 49 } }, + "static": false, "id": { "type": "Identifier", "start": 31, @@ -190,7 +195,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -226,7 +232,8 @@ }, "variance": null } - ] + ], + "exact": false } } }, @@ -235,7 +242,7 @@ ], "kind": "var" } - ] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/42/expected.json b/test/fixtures/flow/type-annotations/42/expected.json index 41e59eda82..c02588c4e6 100644 --- a/test/fixtures/flow/type-annotations/42/expected.json +++ b/test/fixtures/flow/type-annotations/42/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 48 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -157,7 +158,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -205,7 +207,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -268,7 +271,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "Array" }, "name": "Array" } @@ -291,6 +295,7 @@ } } }, + "static": false, "key": { "type": "Identifier", "start": 8, @@ -303,14 +308,16 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "add" }, "name": "add" }, "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -319,7 +326,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/43/expected.json b/test/fixtures/flow/type-annotations/43/expected.json index 5c47531465..f74ef8a76c 100644 --- a/test/fixtures/flow/type-annotations/43/expected.json +++ b/test/fixtures/flow/type-annotations/43/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -157,7 +158,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -189,7 +191,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "T" }, "name": "T" } @@ -226,7 +229,8 @@ "column": 13 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -257,12 +261,14 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "T" }, "name": "T" } } }, + "static": false, "key": { "type": "Identifier", "start": 9, @@ -275,14 +281,16 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "id" }, "name": "id" }, "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, diff --git a/test/fixtures/flow/type-annotations/44/expected.json b/test/fixtures/flow/type-annotations/44/expected.json index fe5e161b5b..2859b99a3d 100644 --- a/test/fixtures/flow/type-annotations/44/expected.json +++ b/test/fixtures/flow/type-annotations/44/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -144,7 +145,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "Array" }, "name": "Array" } diff --git a/test/fixtures/flow/type-annotations/45/expected.json b/test/fixtures/flow/type-annotations/45/expected.json index b56df4cd7d..369cc5973e 100644 --- a/test/fixtures/flow/type-annotations/45/expected.json +++ b/test/fixtures/flow/type-annotations/45/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -132,7 +134,8 @@ "column": 15 } }, - "name": "T" + "name": "T", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-annotations/46/expected.json b/test/fixtures/flow/type-annotations/46/expected.json index e14dc6e612..22ae4951bf 100644 --- a/test/fixtures/flow/type-annotations/46/expected.json +++ b/test/fixtures/flow/type-annotations/46/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 1 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -132,7 +134,8 @@ "column": 15 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -148,7 +151,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "Bar" }, "name": "Bar" }, @@ -194,7 +198,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "T" }, "name": "T" } diff --git a/test/fixtures/flow/type-annotations/47/expected.json b/test/fixtures/flow/type-annotations/47/expected.json index 00836457fd..911bf4b32b 100644 --- a/test/fixtures/flow/type-annotations/47/expected.json +++ b/test/fixtures/flow/type-annotations/47/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -87,7 +88,8 @@ "column": 11 } }, - "name": "T" + "name": "T", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-annotations/48/expected.json b/test/fixtures/flow/type-annotations/48/expected.json index e47282901d..aedd16db88 100644 --- a/test/fixtures/flow/type-annotations/48/expected.json +++ b/test/fixtures/flow/type-annotations/48/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -87,7 +88,8 @@ "column": 11 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -103,7 +105,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "Bar" }, "name": "Bar" }, @@ -149,7 +152,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "T" }, "name": "T" } diff --git a/test/fixtures/flow/type-annotations/49/expected.json b/test/fixtures/flow/type-annotations/49/expected.json index caeb365866..d75e33a263 100644 --- a/test/fixtures/flow/type-annotations/49/expected.json +++ b/test/fixtures/flow/type-annotations/49/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -87,7 +88,8 @@ "column": 11 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "mixin" }, "name": "mixin" }, @@ -134,7 +137,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "Bar" }, "name": "Bar" } diff --git a/test/fixtures/flow/type-annotations/5/expected.json b/test/fixtures/flow/type-annotations/5/expected.json index f68cf9d341..17d938d5d6 100644 --- a/test/fixtures/flow/type-annotations/5/expected.json +++ b/test/fixtures/flow/type-annotations/5/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "untypedVal" }, "name": "untypedVal" }, @@ -89,7 +92,8 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "numVal" }, "name": "numVal", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/50/expected.json b/test/fixtures/flow/type-annotations/50/expected.json index 31174046a3..ded300b573 100644 --- a/test/fixtures/flow/type-annotations/50/expected.json +++ b/test/fixtures/flow/type-annotations/50/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -87,7 +88,8 @@ "column": 11 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -121,6 +123,7 @@ "column": 45 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -134,11 +137,11 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "bar" }, "name": "bar" }, - "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -169,7 +172,8 @@ "column": 20 } }, - "name": "U" + "name": "U", + "variance": null } ] }, @@ -206,7 +210,8 @@ "column": 30 } } - } + }, + "predicate": null }, "body": { "type": "BlockStatement", diff --git a/test/fixtures/flow/type-annotations/51/expected.json b/test/fixtures/flow/type-annotations/51/expected.json index a17c526b21..333398285e 100644 --- a/test/fixtures/flow/type-annotations/51/expected.json +++ b/test/fixtures/flow/type-annotations/51/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 26 } }, + "static": false, "computed": false, "key": { "type": "StringLiteral", @@ -109,7 +111,6 @@ }, "value": "bar" }, - "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -140,7 +141,8 @@ "column": 19 } }, - "name": "T" + "name": "T", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-annotations/52/expected.json b/test/fixtures/flow/type-annotations/52/expected.json index 6a7b1c6f37..ccd862000e 100644 --- a/test/fixtures/flow/type-annotations/52/expected.json +++ b/test/fixtures/flow/type-annotations/52/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "requiredParam" }, "name": "requiredParam" }, @@ -89,7 +92,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "optParam" }, "name": "optParam", "optional": true diff --git a/test/fixtures/flow/type-annotations/53/expected.json b/test/fixtures/flow/type-annotations/53/expected.json index 92988c85ef..c07a57c007 100644 --- a/test/fixtures/flow/type-annotations/53/expected.json +++ b/test/fixtures/flow/type-annotations/53/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 25 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,12 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "prop1" }, "name": "prop1" }, - "static": false, + "variance": null, "typeAnnotation": { "type": "TypeAnnotation", "start": 17, @@ -152,6 +155,7 @@ "column": 39 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -165,11 +169,12 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "prop2" }, "name": "prop2" }, - "static": false, + "variance": null, "typeAnnotation": { "type": "TypeAnnotation", "start": 31, @@ -205,7 +210,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/54/expected.json b/test/fixtures/flow/type-annotations/54/expected.json index 02529f9695..4090718b15 100644 --- a/test/fixtures/flow/type-annotations/54/expected.json +++ b/test/fixtures/flow/type-annotations/54/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "Foo" }, "name": "Foo" }, @@ -88,6 +89,7 @@ "column": 32 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,12 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "prop1" }, "name": "prop1" }, - "static": true, + "variance": null, "typeAnnotation": { "type": "TypeAnnotation", "start": 24, @@ -152,6 +155,7 @@ "column": 46 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -165,11 +169,12 @@ "end": { "line": 1, "column": 38 - } + }, + "identifierName": "prop2" }, "name": "prop2" }, - "static": false, + "variance": null, "typeAnnotation": { "type": "TypeAnnotation", "start": 38, @@ -205,7 +210,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/55/expected.json b/test/fixtures/flow/type-annotations/55/expected.json index 5bc636b4dc..a80a013230 100644 --- a/test/fixtures/flow/type-annotations/55/expected.json +++ b/test/fixtures/flow/type-annotations/55/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/56/expected.json b/test/fixtures/flow/type-annotations/56/expected.json index 91bd2b0584..e21a5ba16d 100644 --- a/test/fixtures/flow/type-annotations/56/expected.json +++ b/test/fixtures/flow/type-annotations/56/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "Array" }, "name": "Array" }, @@ -88,6 +89,7 @@ "column": 46 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -101,11 +103,11 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "concat" }, "name": "concat" }, - "static": false, "kind": "method", "id": null, "generator": false, @@ -124,7 +126,8 @@ "end": { "line": 1, "column": 42 - } + }, + "identifierName": "items" }, "name": "items", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/57/expected.json b/test/fixtures/flow/type-annotations/57/expected.json index b151b8b6f8..263c1d403d 100644 --- a/test/fixtures/flow/type-annotations/57/expected.json +++ b/test/fixtures/flow/type-annotations/57/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -183,7 +184,8 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "fn" }, "name": "fn" } @@ -191,7 +193,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/58/expected.json b/test/fixtures/flow/type-annotations/58/expected.json index ffcb523252..04cfd23ca8 100644 --- a/test/fixtures/flow/type-annotations/58/expected.json +++ b/test/fixtures/flow/type-annotations/58/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -127,7 +128,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "Y" }, "name": "Y" } @@ -147,7 +149,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "Y" }, "name": "Y" } @@ -155,7 +158,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/59/expected.json b/test/fixtures/flow/type-annotations/59/expected.json index d512092524..a91682b647 100644 --- a/test/fixtures/flow/type-annotations/59/expected.json +++ b/test/fixtures/flow/type-annotations/59/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -142,7 +143,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "Y" }, "name": "Y" } @@ -179,7 +181,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "Y" }, "name": "Y" } @@ -187,7 +190,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/6/expected.json b/test/fixtures/flow/type-annotations/6/expected.json index 9cfdcd0139..9e785ac1c7 100644 --- a/test/fixtures/flow/type-annotations/6/expected.json +++ b/test/fixtures/flow/type-annotations/6/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "nullableNum" }, "name": "nullableNum", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/60/expected.json b/test/fixtures/flow/type-annotations/60/expected.json index c7c805bc0d..41854c7041 100644 --- a/test/fixtures/flow/type-annotations/60/expected.json +++ b/test/fixtures/flow/type-annotations/60/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } } ], @@ -179,7 +184,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -199,10 +205,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -250,7 +258,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/flow/type-annotations/61/expected.json b/test/fixtures/flow/type-annotations/61/expected.json index 5745269b9c..b08974f765 100644 --- a/test/fixtures/flow/type-annotations/61/expected.json +++ b/test/fixtures/flow/type-annotations/61/expected.json @@ -101,7 +101,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -117,9 +118,13 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } } ], @@ -179,7 +184,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -199,10 +205,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -250,7 +258,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/flow/type-annotations/62/expected.json b/test/fixtures/flow/type-annotations/62/expected.json index 7201193e8a..b858b1634b 100644 --- a/test/fixtures/flow/type-annotations/62/expected.json +++ b/test/fixtures/flow/type-annotations/62/expected.json @@ -84,7 +84,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" } @@ -161,7 +162,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "Array" }, "name": "Array" } diff --git a/test/fixtures/flow/type-annotations/63/expected.json b/test/fixtures/flow/type-annotations/63/expected.json index 085e483fb1..e9bbce62ed 100644 --- a/test/fixtures/flow/type-annotations/63/expected.json +++ b/test/fixtures/flow/type-annotations/63/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -106,7 +107,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -122,9 +124,13 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } } ], @@ -184,7 +190,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -204,10 +211,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } } diff --git a/test/fixtures/flow/type-annotations/64/expected.json b/test/fixtures/flow/type-annotations/64/expected.json index 8c9d19d6c2..fe08875e33 100644 --- a/test/fixtures/flow/type-annotations/64/expected.json +++ b/test/fixtures/flow/type-annotations/64/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "ArrayPattern", @@ -88,7 +90,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "x" }, "name": "x" } @@ -165,7 +168,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "Array" }, "name": "Array" } diff --git a/test/fixtures/flow/type-annotations/65/expected.json b/test/fixtures/flow/type-annotations/65/expected.json index 17d3f9e5c0..4b88153abb 100644 --- a/test/fixtures/flow/type-annotations/65/expected.json +++ b/test/fixtures/flow/type-annotations/65/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "RestElement", @@ -87,7 +89,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "rest" }, "name": "rest" }, @@ -163,7 +166,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "Array" }, "name": "Array" } diff --git a/test/fixtures/flow/type-annotations/66/expected.json b/test/fixtures/flow/type-annotations/66/expected.json index 33bccbd102..e384b2d0cd 100644 --- a/test/fixtures/flow/type-annotations/66/expected.json +++ b/test/fixtures/flow/type-annotations/66/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "RestElement", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "rest" }, "name": "rest" }, @@ -162,7 +164,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "Array" }, "name": "Array" } @@ -188,7 +191,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/flow/type-annotations/67/expected.json b/test/fixtures/flow/type-annotations/67/expected.json index 29c7ecb1b2..3e63de0f6d 100644 --- a/test/fixtures/flow/type-annotations/67/expected.json +++ b/test/fixtures/flow/type-annotations/67/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -115,11 +116,13 @@ "column": 20 } } - } + }, + "predicate": null }, "id": null, "generator": false, "expression": true, + "async": false, "params": [], "body": { "type": "Identifier", @@ -133,7 +136,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/flow/type-annotations/68/expected.json b/test/fixtures/flow/type-annotations/68/expected.json index 433bc78a8f..9e256a6a4d 100644 --- a/test/fixtures/flow/type-annotations/68/expected.json +++ b/test/fixtures/flow/type-annotations/68/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -87,9 +88,41 @@ "column": 30 } }, + "returnType": { + "type": "TypeAnnotation", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + } + }, + "predicate": null + }, "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -103,7 +136,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -120,39 +154,10 @@ "end": { "line": 1, "column": 30 - } - }, - "name": "bar" - }, - "returnType": { - "type": "TypeAnnotation", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 }, - "end": { - "line": 1, - "column": 23 - } + "identifierName": "bar" }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } - } + "name": "bar" } } } diff --git a/test/fixtures/flow/type-annotations/69/expected.json b/test/fixtures/flow/type-annotations/69/expected.json index 81386821a4..9a862eea68 100644 --- a/test/fixtures/flow/type-annotations/69/expected.json +++ b/test/fixtures/flow/type-annotations/69/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -104,7 +105,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "foo" }, "name": "foo", "typeAnnotation": { @@ -148,7 +150,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -167,7 +170,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "bar" }, "name": "bar", "typeAnnotation": { @@ -211,7 +215,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -244,4 +249,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/7/expected.json b/test/fixtures/flow/type-annotations/7/expected.json index 6a7ceea68d..3233cf98e6 100644 --- a/test/fixtures/flow/type-annotations/7/expected.json +++ b/test/fixtures/flow/type-annotations/7/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "callback" }, "name": "callback", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/70/expected.json b/test/fixtures/flow/type-annotations/70/expected.json index 9efcc0ee81..349a54e218 100644 --- a/test/fixtures/flow/type-annotations/70/expected.json +++ b/test/fixtures/flow/type-annotations/70/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/flow/type-annotations/71/expected.json b/test/fixtures/flow/type-annotations/71/expected.json index cdb81eb204..635549a0b6 100644 --- a/test/fixtures/flow/type-annotations/71/expected.json +++ b/test/fixtures/flow/type-annotations/71/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -151,7 +153,8 @@ "end": { "line": 1, "column": 36 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/flow/type-annotations/72/expected.json b/test/fixtures/flow/type-annotations/72/expected.json index f6ceb4484c..c13a951af4 100644 --- a/test/fixtures/flow/type-annotations/72/expected.json +++ b/test/fixtures/flow/type-annotations/72/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -115,11 +116,13 @@ "column": 21 } } - } + }, + "predicate": null }, "id": null, "generator": false, "expression": true, + "async": false, "params": [], "body": { "type": "Identifier", @@ -133,12 +136,14 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "bar" }, "name": "bar" }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 10 } } } diff --git a/test/fixtures/flow/type-annotations/73/expected.json b/test/fixtures/flow/type-annotations/73/expected.json index 3b2f689738..a1b6cfa22b 100644 --- a/test/fixtures/flow/type-annotations/73/expected.json +++ b/test/fixtures/flow/type-annotations/73/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -87,9 +88,41 @@ "column": 31 } }, + "returnType": { + "type": "TypeAnnotation", + "start": 16, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + } + }, + "predicate": null + }, "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -103,7 +136,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -120,42 +154,14 @@ "end": { "line": 1, "column": 31 - } - }, - "name": "bar" - }, - "returnType": { - "type": "TypeAnnotation", - "start": 16, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 16 }, - "end": { - "line": 1, - "column": 24 - } + "identifierName": "bar" }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } - } + "name": "bar" }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 10 } } } diff --git a/test/fixtures/flow/type-annotations/74/expected.json b/test/fixtures/flow/type-annotations/74/expected.json index 2abdde67da..4d9adf8da2 100644 --- a/test/fixtures/flow/type-annotations/74/expected.json +++ b/test/fixtures/flow/type-annotations/74/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -101,9 +102,41 @@ "column": 32 } }, + "returnType": { + "type": "TypeAnnotation", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + } + }, + "predicate": null + }, "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -117,7 +150,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -134,42 +168,14 @@ "end": { "line": 1, "column": 32 - } - }, - "name": "bar" - }, - "returnType": { - "type": "TypeAnnotation", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 17 }, - "end": { - "line": 1, - "column": 25 - } + "identifierName": "bar" }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } - } + "name": "bar" }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 11 } }, "typeAnnotation": { @@ -203,7 +209,8 @@ } }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 10 } } } diff --git a/test/fixtures/flow/type-annotations/75/expected.json b/test/fixtures/flow/type-annotations/75/expected.json index cf53aaad99..7c9d750b34 100644 --- a/test/fixtures/flow/type-annotations/75/expected.json +++ b/test/fixtures/flow/type-annotations/75/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "bar" }, "name": "bar" }, diff --git a/test/fixtures/flow/type-annotations/76/expected.json b/test/fixtures/flow/type-annotations/76/expected.json index 2201b81b00..0da85e881f 100644 --- a/test/fixtures/flow/type-annotations/76/expected.json +++ b/test/fixtures/flow/type-annotations/76/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -134,7 +135,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -151,7 +153,8 @@ "end": { "line": 1, "column": 37 - } + }, + "identifierName": "bar" }, "name": "bar" }, diff --git a/test/fixtures/flow/type-annotations/77/expected.json b/test/fixtures/flow/type-annotations/77/expected.json index 43b02e527c..04a3bb7902 100644 --- a/test/fixtures/flow/type-annotations/77/expected.json +++ b/test/fixtures/flow/type-annotations/77/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -148,7 +149,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -165,7 +167,8 @@ "end": { "line": 1, "column": 38 - } + }, + "identifierName": "bar" }, "name": "bar" }, diff --git a/test/fixtures/flow/type-annotations/78/expected.json b/test/fixtures/flow/type-annotations/78/expected.json index eec39a30b0..53f958f35d 100644 --- a/test/fixtures/flow/type-annotations/78/expected.json +++ b/test/fixtures/flow/type-annotations/78/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -115,11 +117,13 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "foo" }, "name": "foo", "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 16 } }, "alternate": { @@ -134,7 +138,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "number" }, "name": "number" } diff --git a/test/fixtures/flow/type-annotations/79/expected.json b/test/fixtures/flow/type-annotations/79/expected.json index fe1dab6354..6975ffcfda 100644 --- a/test/fixtures/flow/type-annotations/79/expected.json +++ b/test/fixtures/flow/type-annotations/79/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -99,7 +100,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -117,9 +119,41 @@ "column": 36 } }, + "returnType": { + "type": "TypeAnnotation", + "start": 22, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + } + } + }, + "predicate": null + }, "id": null, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -133,7 +167,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -154,36 +189,6 @@ }, "body": [], "directives": [] - }, - "returnType": { - "type": "TypeAnnotation", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "typeAnnotation": { - "type": "NumberTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } - } } }, "alternate": { @@ -198,7 +203,8 @@ "end": { "line": 1, "column": 42 - } + }, + "identifierName": "baz" }, "name": "baz" } diff --git a/test/fixtures/flow/type-annotations/8/expected.json b/test/fixtures/flow/type-annotations/8/expected.json index 55750a0092..2d082a8233 100644 --- a/test/fixtures/flow/type-annotations/8/expected.json +++ b/test/fixtures/flow/type-annotations/8/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "callback" }, "name": "callback", "typeAnnotation": { diff --git a/test/fixtures/flow/type-annotations/80/expected.json b/test/fixtures/flow/type-annotations/80/expected.json index 5df2f5ec56..a86ca15185 100644 --- a/test/fixtures/flow/type-annotations/80/expected.json +++ b/test/fixtures/flow/type-annotations/80/expected.json @@ -59,6 +59,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "RestElement", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "rest" }, "name": "rest" }, @@ -162,7 +164,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "Array" }, "name": "Array" } @@ -182,16 +185,18 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "rest" }, "name": "rest" }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/81/expected.json b/test/fixtures/flow/type-annotations/81/expected.json index 3c84d22193..1dcedf1a3e 100644 --- a/test/fixtures/flow/type-annotations/81/expected.json +++ b/test/fixtures/flow/type-annotations/81/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -188,7 +189,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "Array" }, "name": "Array" } @@ -207,7 +209,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "Map" }, "name": "Map" } @@ -219,7 +222,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/82/expected.json b/test/fixtures/flow/type-annotations/82/expected.json index f7e3aa404c..9ddf85cb5a 100644 --- a/test/fixtures/flow/type-annotations/82/expected.json +++ b/test/fixtures/flow/type-annotations/82/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 33 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -188,7 +189,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "Array" }, "name": "Array" } @@ -207,7 +209,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "Map" }, "name": "Map" } @@ -219,7 +222,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/83/expected.json b/test/fixtures/flow/type-annotations/83/expected.json index ec761b745f..4a628f8b88 100644 --- a/test/fixtures/flow/type-annotations/83/expected.json +++ b/test/fixtures/flow/type-annotations/83/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -123,7 +124,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/84/expected.json b/test/fixtures/flow/type-annotations/84/expected.json index 72f1dcf9d6..cc9842db23 100644 --- a/test/fixtures/flow/type-annotations/84/expected.json +++ b/test/fixtures/flow/type-annotations/84/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -138,7 +139,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/85/expected.json b/test/fixtures/flow/type-annotations/85/expected.json index 2ec29ac271..82341068bc 100644 --- a/test/fixtures/flow/type-annotations/85/expected.json +++ b/test/fixtures/flow/type-annotations/85/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -158,7 +159,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "Promise" }, "name": "Promise" } @@ -171,7 +173,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/86/expected.json b/test/fixtures/flow/type-annotations/86/expected.json index 910267d15d..63ccb81eb2 100644 --- a/test/fixtures/flow/type-annotations/86/expected.json +++ b/test/fixtures/flow/type-annotations/86/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -127,7 +128,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "rest" }, "name": "rest" }, @@ -190,7 +192,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "Array" }, "name": "Array" } @@ -220,7 +223,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/87/expected.json b/test/fixtures/flow/type-annotations/87/expected.json index fcb3f099e8..d6b70d48e8 100644 --- a/test/fixtures/flow/type-annotations/87/expected.json +++ b/test/fixtures/flow/type-annotations/87/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "identity" }, "name": "identity", "typeAnnotation": { @@ -129,7 +130,8 @@ "column": 16 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -160,7 +162,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -192,7 +195,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "T" }, "name": "T" } @@ -227,7 +231,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "T" }, "name": "T" } diff --git a/test/fixtures/flow/type-annotations/88/expected.json b/test/fixtures/flow/type-annotations/88/expected.json index 703ae28f97..e7495a1ba3 100644 --- a/test/fixtures/flow/type-annotations/88/expected.json +++ b/test/fixtures/flow/type-annotations/88/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 38 - } + }, + "identifierName": "identity" }, "name": "identity", "typeAnnotation": { @@ -129,7 +130,8 @@ "column": 16 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -160,7 +162,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -192,7 +195,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "T" }, "name": "T" } @@ -225,7 +229,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -271,7 +276,8 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "T" }, "name": "T" } @@ -305,7 +311,8 @@ "end": { "line": 1, "column": 38 - } + }, + "identifierName": "T" }, "name": "T" } diff --git a/test/fixtures/flow/type-annotations/89/expected.json b/test/fixtures/flow/type-annotations/89/expected.json index fafb7c0a97..8e0461be54 100644 --- a/test/fixtures/flow/type-annotations/89/expected.json +++ b/test/fixtures/flow/type-annotations/89/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/flow/type-annotations/9/expected.json b/test/fixtures/flow/type-annotations/9/expected.json index d2393788e5..a966a64756 100644 --- a/test/fixtures/flow/type-annotations/9/expected.json +++ b/test/fixtures/flow/type-annotations/9/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", @@ -73,7 +75,8 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "callback" }, "name": "callback", "typeAnnotation": { @@ -131,7 +134,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "_" }, "name": "_" }, diff --git a/test/fixtures/flow/type-annotations/90/expected.json b/test/fixtures/flow/type-annotations/90/expected.json index d18d05b185..d098b0cce8 100644 --- a/test/fixtures/flow/type-annotations/90/expected.json +++ b/test/fixtures/flow/type-annotations/90/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/flow/type-annotations/91/expected.json b/test/fixtures/flow/type-annotations/91/expected.json index 508d8b7fd6..d92c31cc91 100644 --- a/test/fixtures/flow/type-annotations/91/expected.json +++ b/test/fixtures/flow/type-annotations/91/expected.json @@ -69,10 +69,12 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "foo" }, "name": "foo" }, + "importKind": null, "local": { "type": "Identifier", "start": 13, @@ -85,7 +87,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "foo" }, "name": "foo" } @@ -116,10 +119,12 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "bar" }, "name": "bar" }, + "importKind": null, "local": { "type": "Identifier", "start": 18, @@ -132,7 +137,8 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/flow/type-annotations/92/expected.json b/test/fixtures/flow/type-annotations/92/expected.json index 3bf07813d5..f655b4ac19 100644 --- a/test/fixtures/flow/type-annotations/92/expected.json +++ b/test/fixtures/flow/type-annotations/92/expected.json @@ -69,10 +69,12 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "foo" }, "name": "foo" }, + "importKind": null, "local": { "type": "Identifier", "start": 22, @@ -85,7 +87,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "bar" }, "name": "bar" } diff --git a/test/fixtures/flow/type-annotations/93/expected.json b/test/fixtures/flow/type-annotations/93/expected.json index 588d644b5a..f28a6ae4c4 100644 --- a/test/fixtures/flow/type-annotations/93/expected.json +++ b/test/fixtures/flow/type-annotations/93/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "type" }, "name": "type" } diff --git a/test/fixtures/flow/type-annotations/94/expected.json b/test/fixtures/flow/type-annotations/94/expected.json index 71f88f5ecd..75eb3f453a 100644 --- a/test/fixtures/flow/type-annotations/94/expected.json +++ b/test/fixtures/flow/type-annotations/94/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "type" }, "name": "type" } @@ -100,10 +101,12 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" }, + "importKind": null, "local": { "type": "Identifier", "start": 14, @@ -116,7 +119,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/flow/type-annotations/95/expected.json b/test/fixtures/flow/type-annotations/95/expected.json index d90a424b63..ba8c5759bb 100644 --- a/test/fixtures/flow/type-annotations/95/expected.json +++ b/test/fixtures/flow/type-annotations/95/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "namespace" }, "name": "namespace" } diff --git a/test/fixtures/flow/type-annotations/96/expected.json b/test/fixtures/flow/type-annotations/96/expected.json index 11ed46da39..b102606c92 100644 --- a/test/fixtures/flow/type-annotations/96/expected.json +++ b/test/fixtures/flow/type-annotations/96/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "namespace" }, "name": "namespace" } diff --git a/test/fixtures/flow/type-annotations/97/expected.json b/test/fixtures/flow/type-annotations/97/expected.json index 4b3c3b2da9..6021547089 100644 --- a/test/fixtures/flow/type-annotations/97/expected.json +++ b/test/fixtures/flow/type-annotations/97/expected.json @@ -86,7 +86,8 @@ "end": { "line": 1, "column": 3 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -137,7 +138,8 @@ "column": 16 } }, - "name": "T" + "name": "T", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-annotations/98/expected.json b/test/fixtures/flow/type-annotations/98/expected.json index 953654304c..230760de3a 100644 --- a/test/fixtures/flow/type-annotations/98/expected.json +++ b/test/fixtures/flow/type-annotations/98/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 57 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -128,7 +129,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "param1" }, "name": "param1" }, @@ -148,6 +150,7 @@ } }, "optional": true, + "static": false, "variance": null }, { @@ -176,7 +179,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "param2" }, "name": "param2" }, @@ -196,6 +200,7 @@ } }, "optional": false, + "static": false, "variance": null }, { @@ -224,7 +229,8 @@ "end": { "line": 1, "column": 47 - } + }, + "identifierName": "param3" }, "name": "param3" }, @@ -244,10 +250,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -256,7 +264,7 @@ ], "kind": "var" } - ] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/99/expected.json b/test/fixtures/flow/type-annotations/99/expected.json index b261c3eff9..90620eca01 100644 --- a/test/fixtures/flow/type-annotations/99/expected.json +++ b/test/fixtures/flow/type-annotations/99/expected.json @@ -56,6 +56,55 @@ "column": 21 } }, + "returnType": { + "type": "TypeAnnotation", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "z" + }, + "name": "z" + } + }, + "predicate": null + }, "id": null, "generator": false, "expression": true, @@ -73,7 +122,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -89,7 +139,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "bar" }, "name": "bar" } @@ -108,322 +159,10 @@ "column": 21 } } - }, - "returnType": { - "type": "TypeAnnotation", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "typeAnnotation": { - "type": "GenericTypeAnnotation", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, - "name": "z" - } - } } } } ], "directives": [] - }, - "comments": [], - "tokens": [ - { - "type": { - "label": "(", - "beforeExpr": true, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "foo", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - } - }, - { - "type": { - "label": ",", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "bar", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - } - }, - { - "type": { - "label": ")", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - } - } - }, - { - "type": { - "label": ":", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - } - } - }, - { - "type": { - "label": "name", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null - }, - "value": "z", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - { - "type": { - "label": "=>", - "beforeExpr": true, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - - - }, - "end": { - "line": 1, - "column": 16 - } - } - }, - { - "type": { - "label": "null", - "keyword": "null", - "beforeExpr": false, - "startsExpr": true, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "value": "null", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - } - }, - { - "type": { - "label": "eof", - "beforeExpr": false, - "startsExpr": false, - "rightAssociative": false, - "isLoop": false, - "isAssign": false, - "prefix": false, - "postfix": false, - "binop": null, - "updateContext": null - }, - "start": 21, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 21 - } - } - } - ] -} + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/arrow-func-return-newline/expected.json b/test/fixtures/flow/type-annotations/arrow-func-return-newline/expected.json index cf9973aad7..5ed4f9d38d 100644 --- a/test/fixtures/flow/type-annotations/arrow-func-return-newline/expected.json +++ b/test/fixtures/flow/type-annotations/arrow-func-return-newline/expected.json @@ -116,7 +116,8 @@ "column": 8 } } - } + }, + "predicate": null }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/builtin/expected.json b/test/fixtures/flow/type-annotations/builtin/expected.json index 189484fe9d..c60b595377 100644 --- a/test/fixtures/flow/type-annotations/builtin/expected.json +++ b/test/fixtures/flow/type-annotations/builtin/expected.json @@ -597,11 +597,11 @@ "column": 11 } }, - "value": "", "extra": { "rawValue": "", "raw": "\"\"" - } + }, + "value": "" } }, { @@ -650,11 +650,11 @@ "column": 10 } }, - "value": 0, "extra": { "rawValue": 0, "raw": "0" - } + }, + "value": 0 } }, { diff --git a/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json b/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json index ce2c3dc1c1..8a6e657af3 100644 --- a/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json +++ b/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "f" }, "name": "f", "typeAnnotation": { @@ -145,7 +146,8 @@ "column": 31 } } - } + }, + "predicate": null }, "id": null, "generator": false, @@ -164,7 +166,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -257,4 +260,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/existential-type-param/expected.json b/test/fixtures/flow/type-annotations/existential-type-param/expected.json index 7739b86598..af0ae0e2bd 100644 --- a/test/fixtures/flow/type-annotations/existential-type-param/expected.json +++ b/test/fixtures/flow/type-annotations/existential-type-param/expected.json @@ -54,7 +54,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "Maybe" }, "name": "Maybe" }, @@ -87,7 +88,8 @@ "column": 12 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -147,7 +149,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "T" }, "name": "T" } @@ -181,7 +184,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "_Maybe" }, "name": "_Maybe" } @@ -190,4 +194,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/negative-number-literal/expected.json b/test/fixtures/flow/type-annotations/negative-number-literal/expected.json index 0aaa813aa2..e3fe56e9dc 100644 --- a/test/fixtures/flow/type-annotations/negative-number-literal/expected.json +++ b/test/fixtures/flow/type-annotations/negative-number-literal/expected.json @@ -89,11 +89,11 @@ "column": 6 } }, - "value": -1, "extra": { "rawValue": -1, "raw": "-1" - } + }, + "value": -1 }, { "type": "NumberLiteralTypeAnnotation", @@ -109,11 +109,11 @@ "column": 5 } }, - "value": 0, "extra": { "rawValue": 0, "raw": "0" - } + }, + "value": 0 }, { "type": "NumberLiteralTypeAnnotation", @@ -129,11 +129,11 @@ "column": 5 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 } ] }, @@ -417,4 +417,4 @@ } } ] -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-exports/alias/expected.json b/test/fixtures/flow/type-exports/alias/expected.json index 7387d671c4..cf8a9daf6e 100644 --- a/test/fixtures/flow/type-exports/alias/expected.json +++ b/test/fixtures/flow/type-exports/alias/expected.json @@ -42,9 +42,9 @@ "column": 23 } }, - "exportKind": "type", "specifiers": [], "source": null, + "exportKind": "type", "declaration": { "type": "TypeAlias", "start": 7, @@ -71,7 +71,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -93,6 +94,7 @@ } } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/flow/type-exports/interface/expected.json b/test/fixtures/flow/type-exports/interface/expected.json index ee9953051b..45366de3c4 100644 --- a/test/fixtures/flow/type-exports/interface/expected.json +++ b/test/fixtures/flow/type-exports/interface/expected.json @@ -71,7 +71,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -120,7 +121,8 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "p" }, "name": "p" }, @@ -140,10 +142,12 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -205,7 +209,8 @@ "end": { "line": 2, "column": 20 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -238,7 +243,8 @@ "column": 22 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -286,7 +292,8 @@ "end": { "line": 2, "column": 27 - } + }, + "identifierName": "p" }, "name": "p" }, @@ -317,16 +324,19 @@ "end": { "line": 2, "column": 30 - } + }, + "identifierName": "T" }, "name": "T" } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -348,4 +358,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-exports/specifier-from/expected.json b/test/fixtures/flow/type-exports/specifier-from/expected.json index 583326b8a1..79e5af591c 100644 --- a/test/fixtures/flow/type-exports/specifier-from/expected.json +++ b/test/fixtures/flow/type-exports/specifier-from/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -85,7 +86,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" } diff --git a/test/fixtures/flow/type-exports/specifier/expected.json b/test/fixtures/flow/type-exports/specifier/expected.json index 37900069e8..7715724c0d 100644 --- a/test/fixtures/flow/type-exports/specifier/expected.json +++ b/test/fixtures/flow/type-exports/specifier/expected.json @@ -42,7 +42,6 @@ "column": 20 } }, - "exportKind": "type", "specifiers": [ { "type": "ExportSpecifier", @@ -70,7 +69,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" }, @@ -86,15 +86,18 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" } } ], "source": null, + "exportKind": "type", "declaration": null } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/flow/type-grouping/1/expected.json b/test/fixtures/flow/type-grouping/1/expected.json index 7b9b6309f8..b88c7b544c 100644 --- a/test/fixtures/flow/type-grouping/1/expected.json +++ b/test/fixtures/flow/type-grouping/1/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -108,7 +109,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-grouping/2/expected.json b/test/fixtures/flow/type-grouping/2/expected.json index 60fb976af8..9e84a8c5c1 100644 --- a/test/fixtures/flow/type-grouping/2/expected.json +++ b/test/fixtures/flow/type-grouping/2/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 36 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -176,7 +177,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-grouping/3/expected.json b/test/fixtures/flow/type-grouping/3/expected.json index a51a1dce92..fe1a494b08 100644 --- a/test/fixtures/flow/type-grouping/3/expected.json +++ b/test/fixtures/flow/type-grouping/3/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -172,7 +173,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-grouping/4/expected.json b/test/fixtures/flow/type-grouping/4/expected.json index 3a2c2d5359..817a0c95f3 100644 --- a/test/fixtures/flow/type-grouping/4/expected.json +++ b/test/fixtures/flow/type-grouping/4/expected.json @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, "name": "a", "typeAnnotation": { @@ -127,7 +128,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "A" }, "name": "A" } @@ -140,7 +142,7 @@ ], "kind": "var" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/flow/type-imports/import-type-shorthand/expected.json b/test/fixtures/flow/type-imports/import-type-shorthand/expected.json index 7b3d80f439..6c0fc4995b 100644 --- a/test/fixtures/flow/type-imports/import-type-shorthand/expected.json +++ b/test/fixtures/flow/type-imports/import-type-shorthand/expected.json @@ -647,4 +647,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-imports/import-type/expected.json b/test/fixtures/flow/type-imports/import-type/expected.json index 2b23f221b3..af41bafe4d 100644 --- a/test/fixtures/flow/type-imports/import-type/expected.json +++ b/test/fixtures/flow/type-imports/import-type/expected.json @@ -144,6 +144,7 @@ }, "name": "named" }, + "importKind": null, "local": { "type": "Identifier", "start": 39, @@ -263,6 +264,7 @@ }, "name": "named" }, + "importKind": null, "local": { "type": "Identifier", "start": 74, diff --git a/test/fixtures/flow/type-parameter-declaration/arrow_with_jsx/expected.json b/test/fixtures/flow/type-parameter-declaration/arrow_with_jsx/expected.json index 5040de57dc..357be6ee1e 100644 --- a/test/fixtures/flow/type-parameter-declaration/arrow_with_jsx/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/arrow_with_jsx/expected.json @@ -110,7 +110,8 @@ "column": 2 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -161,7 +162,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" } @@ -215,7 +217,8 @@ "column": 2 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -266,7 +269,8 @@ "end": { "line": 3, "column": 13 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -350,7 +354,8 @@ "column": 2 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -401,7 +406,8 @@ "end": { "line": 4, "column": 13 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -518,7 +524,8 @@ "column": 2 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -527,4 +534,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-parameter-declaration/arrow_without_jsx/expected.json b/test/fixtures/flow/type-parameter-declaration/arrow_without_jsx/expected.json index 5040de57dc..357be6ee1e 100644 --- a/test/fixtures/flow/type-parameter-declaration/arrow_without_jsx/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/arrow_without_jsx/expected.json @@ -110,7 +110,8 @@ "column": 2 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -161,7 +162,8 @@ "end": { "line": 2, "column": 5 - } + }, + "identifierName": "x" }, "name": "x" } @@ -215,7 +217,8 @@ "column": 2 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -266,7 +269,8 @@ "end": { "line": 3, "column": 13 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -350,7 +354,8 @@ "column": 2 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -401,7 +406,8 @@ "end": { "line": 4, "column": 13 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -518,7 +524,8 @@ "column": 2 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -527,4 +534,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-parameter-declaration/class-method-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/class-method-reserved-word/expected.json index 6e0dc70ef3..a836b16d41 100644 --- a/test/fixtures/flow/type-parameter-declaration/class-method-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/class-method-reserved-word/expected.json @@ -89,6 +89,7 @@ "column": 16 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -107,7 +108,6 @@ }, "name": "foobar" }, - "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -138,7 +138,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -179,6 +180,7 @@ "column": 16 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -197,7 +199,6 @@ }, "name": "delete" }, - "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -228,7 +229,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -269,6 +271,7 @@ "column": 15 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -287,7 +290,6 @@ }, "name": "yield" }, - "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -318,7 +320,8 @@ "column": 9 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -359,6 +362,7 @@ "column": 12 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -377,7 +381,6 @@ }, "name": "do" }, - "static": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -408,7 +411,8 @@ "column": 6 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -449,6 +453,7 @@ "column": 23 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -467,7 +472,6 @@ }, "name": "foobar" }, - "static": true, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -498,7 +502,8 @@ "column": 17 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -539,6 +544,7 @@ "column": 23 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -557,7 +563,6 @@ }, "name": "delete" }, - "static": true, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -588,7 +593,8 @@ "column": 17 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -629,6 +635,7 @@ "column": 22 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -647,7 +654,6 @@ }, "name": "yield" }, - "static": true, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -678,7 +684,8 @@ "column": 16 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -719,6 +726,7 @@ "column": 19 } }, + "static": true, "computed": false, "key": { "type": "Identifier", @@ -737,7 +745,6 @@ }, "name": "do" }, - "static": true, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", @@ -768,7 +775,8 @@ "column": 13 } }, - "name": "T" + "name": "T", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json index 9c4ed2864e..a18b53c12e 100644 --- a/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json @@ -137,7 +137,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -236,7 +237,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -335,7 +337,8 @@ "column": 9 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -434,7 +437,8 @@ "column": 6 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -533,7 +537,8 @@ "column": 17 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -632,7 +637,8 @@ "column": 17 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -731,7 +737,8 @@ "column": 16 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -830,7 +837,8 @@ "column": 13 } }, - "name": "T" + "name": "T", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json index 7fe3231b43..834cc17454 100644 --- a/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json @@ -137,7 +137,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -236,7 +237,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -335,7 +337,8 @@ "column": 9 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -434,7 +437,8 @@ "column": 6 } }, - "name": "T" + "name": "T", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-parameter-declaration/default/expected.json b/test/fixtures/flow/type-parameter-declaration/default/expected.json index d545ed4f27..56cf6e37d7 100644 --- a/test/fixtures/flow/type-parameter-declaration/default/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/default/expected.json @@ -3326,4 +3326,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json index f0c82175f1..61ca321ecd 100644 --- a/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json @@ -137,7 +137,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -236,7 +237,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -335,7 +337,8 @@ "column": 9 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -434,7 +437,8 @@ "column": 6 } }, - "name": "T" + "name": "T", + "variance": null } ] }, diff --git a/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/expected.json b/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/expected.json index 801f8ff09c..07d8e1ebe8 100644 --- a/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/expected.json @@ -258,7 +258,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] } diff --git a/test/fixtures/flow/type-parameter-declaration/object-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/object-reserved-word/expected.json index f57adb86f2..c89615b382 100644 --- a/test/fixtures/flow/type-parameter-declaration/object-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/object-reserved-word/expected.json @@ -175,7 +175,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -266,7 +267,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -357,7 +359,8 @@ "column": 9 } }, - "name": "T" + "name": "T", + "variance": null } ] } @@ -448,7 +451,8 @@ "column": 6 } }, - "name": "T" + "name": "T", + "variance": null } ] } diff --git a/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json index 2d85dca630..3f2bac500b 100644 --- a/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json @@ -135,7 +135,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -234,7 +235,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -333,7 +335,8 @@ "column": 9 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -432,7 +435,8 @@ "column": 6 } }, - "name": "T" + "name": "T", + "variance": null } ] }, diff --git a/test/fixtures/flow/typecasts/1/expected.json b/test/fixtures/flow/typecasts/1/expected.json index 87ffc46fab..a73129c312 100644 --- a/test/fixtures/flow/typecasts/1/expected.json +++ b/test/fixtures/flow/typecasts/1/expected.json @@ -68,7 +68,8 @@ "end": { "line": 1, "column": 4 - } + }, + "identifierName": "xxx" }, "name": "xxx" }, @@ -103,7 +104,8 @@ } }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/flow/typecasts/2/expected.json b/test/fixtures/flow/typecasts/2/expected.json index 7f2c10a412..5e58fe24de 100644 --- a/test/fixtures/flow/typecasts/2/expected.json +++ b/test/fixtures/flow/typecasts/2/expected.json @@ -100,7 +100,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "xxx" }, "name": "xxx" }, @@ -154,7 +155,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "yyy" }, "name": "yyy" }, @@ -237,7 +239,8 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "xxx" }, "name": "xxx" }, @@ -257,6 +260,7 @@ } }, "optional": false, + "static": false, "variance": null }, { @@ -285,7 +289,8 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "yyy" }, "name": "yyy" }, @@ -305,14 +310,17 @@ } }, "optional": false, + "static": false, "variance": null } ], - "indexers": [] + "indexers": [], + "exact": false } }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/flow/typecasts/3/expected.json b/test/fixtures/flow/typecasts/3/expected.json index ff1d6fa436..b47396af29 100644 --- a/test/fixtures/flow/typecasts/3/expected.json +++ b/test/fixtures/flow/typecasts/3/expected.json @@ -73,6 +73,7 @@ "id": null, "generator": false, "expression": true, + "async": false, "params": [ { "type": "Identifier", @@ -86,7 +87,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "xxx" }, "name": "xxx" } @@ -117,7 +119,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "xxx" }, "name": "xxx" }, @@ -199,7 +202,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "xxx" }, "name": "xxx" }, @@ -241,7 +245,8 @@ } }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/flow/typecasts/4/expected.json b/test/fixtures/flow/typecasts/4/expected.json index 3fab1290ea..9253542842 100644 --- a/test/fixtures/flow/typecasts/4/expected.json +++ b/test/fixtures/flow/typecasts/4/expected.json @@ -83,7 +83,8 @@ "end": { "line": 1, "column": 5 - } + }, + "identifierName": "xxx" }, "name": "xxx" }, @@ -118,7 +119,8 @@ } }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 1 } }, { @@ -147,7 +149,8 @@ "end": { "line": 1, "column": 20 - } + }, + "identifierName": "yyy" }, "name": "yyy" }, @@ -182,12 +185,14 @@ } }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 16 } } ], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/jsx/basic/1/expected.json b/test/fixtures/jsx/basic/1/expected.json index cc297bc62f..74febd56c0 100644 --- a/test/fixtures/jsx/basic/1/expected.json +++ b/test/fixtures/jsx/basic/1/expected.json @@ -93,7 +93,7 @@ "children": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/14/expected.json b/test/fixtures/jsx/basic/14/expected.json index 283763cbac..397403e48f 100644 --- a/test/fixtures/jsx/basic/14/expected.json +++ b/test/fixtures/jsx/basic/14/expected.json @@ -185,7 +185,7 @@ "children": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/15/expected.json b/test/fixtures/jsx/basic/15/expected.json index 7fc17dcca5..2ac2b7f338 100644 --- a/test/fixtures/jsx/basic/15/expected.json +++ b/test/fixtures/jsx/basic/15/expected.json @@ -247,7 +247,7 @@ "children": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/16/expected.json b/test/fixtures/jsx/basic/16/expected.json index d5331fba92..c3124de3ee 100644 --- a/test/fixtures/jsx/basic/16/expected.json +++ b/test/fixtures/jsx/basic/16/expected.json @@ -106,7 +106,8 @@ "closingElement": null, "children": [], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } }, "operator": "<", @@ -122,7 +123,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" } diff --git a/test/fixtures/jsx/basic/17/expected.json b/test/fixtures/jsx/basic/17/expected.json index cf55b33ede..f6d8f748c1 100644 --- a/test/fixtures/jsx/basic/17/expected.json +++ b/test/fixtures/jsx/basic/17/expected.json @@ -97,7 +97,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "props" }, "name": "props" } @@ -125,7 +126,7 @@ "children": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/18/expected.json b/test/fixtures/jsx/basic/18/expected.json index 643ebce2f5..ecbc6076b7 100644 --- a/test/fixtures/jsx/basic/18/expected.json +++ b/test/fixtures/jsx/basic/18/expected.json @@ -97,7 +97,8 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "props" }, "name": "props" } diff --git a/test/fixtures/jsx/basic/19/expected.json b/test/fixtures/jsx/basic/19/expected.json index e9df7bec55..e18fa97fd0 100644 --- a/test/fixtures/jsx/basic/19/expected.json +++ b/test/fixtures/jsx/basic/19/expected.json @@ -193,7 +193,8 @@ "end": { "line": 1, "column": 45 - } + }, + "identifierName": "props" }, "name": "props" } diff --git a/test/fixtures/jsx/basic/2/expected.json b/test/fixtures/jsx/basic/2/expected.json index ba17f6adcf..971d21320c 100644 --- a/test/fixtures/jsx/basic/2/expected.json +++ b/test/fixtures/jsx/basic/2/expected.json @@ -188,7 +188,7 @@ "children": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/20/expected.json b/test/fixtures/jsx/basic/20/expected.json index 67be9032eb..aa201aac33 100644 --- a/test/fixtures/jsx/basic/20/expected.json +++ b/test/fixtures/jsx/basic/20/expected.json @@ -155,7 +155,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "aa" }, "name": "aa" }, @@ -171,7 +172,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "bb" }, "name": "bb" }, @@ -189,7 +191,8 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "cc" }, "name": "cc" }, @@ -281,7 +284,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "bb" }, "name": "bb" }, @@ -297,7 +301,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "cc" }, "name": "cc" }, @@ -315,7 +320,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "dd" }, "name": "dd" }, @@ -493,7 +499,8 @@ "end": { "line": 1, "column": 39 - } + }, + "identifierName": "aa" }, "name": "aa" }, @@ -509,7 +516,8 @@ "end": { "line": 1, "column": 41 - } + }, + "identifierName": "b" }, "name": "b" }, @@ -521,7 +529,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/21/expected.json b/test/fixtures/jsx/basic/21/expected.json index 8a6cfbda2c..25fba8ed09 100644 --- a/test/fixtures/jsx/basic/21/expected.json +++ b/test/fixtures/jsx/basic/21/expected.json @@ -97,7 +97,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "c" }, "name": "c" } @@ -196,7 +197,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "children" }, "name": "children" } @@ -227,7 +229,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "a" }, "name": "a" } @@ -258,7 +261,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "b" }, "name": "b" } @@ -268,6 +272,5 @@ } ], "directives": [] - }, - "comments": [] -} + } +} \ No newline at end of file diff --git a/test/fixtures/jsx/basic/3/expected.json b/test/fixtures/jsx/basic/3/expected.json index a5cebe4764..7fef3da7b3 100644 --- a/test/fixtures/jsx/basic/3/expected.json +++ b/test/fixtures/jsx/basic/3/expected.json @@ -244,7 +244,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "value" }, "name": "value" } diff --git a/test/fixtures/jsx/basic/5/expected.json b/test/fixtures/jsx/basic/5/expected.json index a9db746b35..31316dc183 100644 --- a/test/fixtures/jsx/basic/5/expected.json +++ b/test/fixtures/jsx/basic/5/expected.json @@ -93,7 +93,7 @@ "children": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/6/expected.json b/test/fixtures/jsx/basic/6/expected.json index 94b18bbb71..98750bdb3f 100644 --- a/test/fixtures/jsx/basic/6/expected.json +++ b/test/fixtures/jsx/basic/6/expected.json @@ -123,7 +123,7 @@ "children": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/8/expected.json b/test/fixtures/jsx/basic/8/expected.json index 06bfadfee7..695a507bb4 100644 --- a/test/fixtures/jsx/basic/8/expected.json +++ b/test/fixtures/jsx/basic/8/expected.json @@ -141,7 +141,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -271,7 +272,7 @@ "children": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/asi/expected.json b/test/fixtures/jsx/basic/asi/expected.json index 73e695d2a6..120125cf19 100644 --- a/test/fixtures/jsx/basic/asi/expected.json +++ b/test/fixtures/jsx/basic/asi/expected.json @@ -54,12 +54,14 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "x" }, "name": "x" }, "generator": false, "expression": false, + "async": false, "params": [], "body": { "type": "BlockStatement", @@ -117,7 +119,8 @@ "end": { "line": 2, "column": 7 - } + }, + "identifierName": "x" }, "name": "x" }, diff --git a/test/fixtures/jsx/basic/empty-expression-container/expected.json b/test/fixtures/jsx/basic/empty-expression-container/expected.json index 157403e9bf..816a67616f 100644 --- a/test/fixtures/jsx/basic/empty-expression-container/expected.json +++ b/test/fixtures/jsx/basic/empty-expression-container/expected.json @@ -137,7 +137,18 @@ }, "expression": { "type": "JSXEmptyExpression", - "loc": {} + "start": 4, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 4 + } + } } } ] diff --git a/test/fixtures/jsx/basic/entity/expected.json b/test/fixtures/jsx/basic/entity/expected.json index 8e4d867723..69f4b59ea6 100644 --- a/test/fixtures/jsx/basic/entity/expected.json +++ b/test/fixtures/jsx/basic/entity/expected.json @@ -136,7 +136,7 @@ } }, "extra": null, - "value": "\uD83D\uDCA9" + "value": "💩" } ] } @@ -144,4 +144,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/jsx/basic/keyword-tag/expected.json b/test/fixtures/jsx/basic/keyword-tag/expected.json index 310e29dd35..a3131a33e9 100644 --- a/test/fixtures/jsx/basic/keyword-tag/expected.json +++ b/test/fixtures/jsx/basic/keyword-tag/expected.json @@ -123,6 +123,7 @@ "children": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/namespace-tag/expected.json b/test/fixtures/jsx/basic/namespace-tag/expected.json index 9070b5a80f..e16d5de485 100644 --- a/test/fixtures/jsx/basic/namespace-tag/expected.json +++ b/test/fixtures/jsx/basic/namespace-tag/expected.json @@ -281,6 +281,7 @@ "children": [] } } - ] + ], + "directives": [] } } \ No newline at end of file diff --git a/test/fixtures/jsx/basic/yield-tag/expected.json b/test/fixtures/jsx/basic/yield-tag/expected.json index 79a13273e6..3cb2a5908c 100644 --- a/test/fixtures/jsx/basic/yield-tag/expected.json +++ b/test/fixtures/jsx/basic/yield-tag/expected.json @@ -1,198 +1,199 @@ { - "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, - "program": { - "type": "Program", + "type": "File", "start": 0, "end": 35, "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, - "sourceType": "script", - "body": [ - { - "type": "FunctionDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { + "start": { "line": 1, "column": 0 - }, - "end": { + }, + "end": { "line": 3, "column": 1 - } - }, - "id": { - "type": "Identifier", - "start": 9, - "end": 11, - "loc": { + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { "start": { - "line": 1, - "column": 9 + "line": 1, + "column": 0 }, "end": { - "line": 1, - "column": 11 + "line": 3, + "column": 1 } - }, - "name": "it" }, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 13, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, - "body": [ + "sourceType": "script", + "body": [ { - "type": "ExpressionStatement", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 18 - } - }, - "expression": { - "type": "YieldExpression", - "start": 19, - "end": 32, + "type": "FunctionDeclaration", + "start": 0, + "end": 35, "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 17 - } - }, - "delegate": false, - "argument": { - "type": "JSXElement", - "start": 25, - "end": 32, - "loc": { "start": { - "line": 2, - "column": 10 + "line": 1, + "column": 0 }, "end": { - "line": 2, - "column": 17 + "line": 3, + "column": 1 } - }, - "openingElement": { - "type": "JSXOpeningElement", - "start": 25, - "end": 28, + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 11, "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - }, - "attributes": [], - "name": { - "type": "JSXIdentifier", - "start": 26, - "end": 27, - "loc": { "start": { - "line": 2, - "column": 11 + "line": 1, + "column": 9 }, "end": { - "line": 2, - "column": 12 - } - }, - "name": "a" + "line": 1, + "column": 11 + }, + "identifierName": "it" }, - "selfClosing": false - }, - "closingElement": { - "type": "JSXClosingElement", - "start": 28, - "end": 32, + "name": "it" + }, + "generator": true, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 35, "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 17 - } - }, - "name": { - "type": "JSXIdentifier", - "start": 30, - "end": 31, - "loc": { "start": { - "line": 2, - "column": 15 + "line": 1, + "column": 13 }, "end": { - "line": 2, - "column": 16 + "line": 3, + "column": 1 } - }, - "name": "a" - } - }, - "children": [] + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "expression": { + "type": "YieldExpression", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "delegate": false, + "argument": { + "type": "JSXElement", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "name": "a" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 28, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "name": "a" + } + }, + "children": [] + } + } + } + ], + "directives": [] } - } } - ], - "directives": [] - } - } - ], - "directives": [] - }, - "comments": [] -} + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/jsx/regression/2/expected.json b/test/fixtures/jsx/regression/2/expected.json index 4983e54932..33898ea946 100644 --- a/test/fixtures/jsx/regression/2/expected.json +++ b/test/fixtures/jsx/regression/2/expected.json @@ -190,7 +190,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "test" }, "name": "test" } @@ -221,7 +222,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/regression/3/expected.json b/test/fixtures/jsx/regression/3/expected.json index d4081dc212..e952ae4a2b 100644 --- a/test/fixtures/jsx/regression/3/expected.json +++ b/test/fixtures/jsx/regression/3/expected.json @@ -179,7 +179,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -195,9 +196,13 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "a" }, "name": "a" + }, + "extra": { + "shorthand": true } } ] diff --git a/test/fixtures/jsx/regression/5/expected.json b/test/fixtures/jsx/regression/5/expected.json index aaf2e26a1d..5e8ebf8b82 100644 --- a/test/fixtures/jsx/regression/5/expected.json +++ b/test/fixtures/jsx/regression/5/expected.json @@ -147,7 +147,8 @@ "end": { "line": 1, "column": 7 - } + }, + "identifierName": "a" }, "name": "a" } @@ -178,7 +179,8 @@ "end": { "line": 1, "column": 10 - } + }, + "identifierName": "b" }, "name": "b" } @@ -186,7 +188,7 @@ ] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/jsx/regression/6/expected.json b/test/fixtures/jsx/regression/6/expected.json index 44b08551ed..fbfd450b91 100644 --- a/test/fixtures/jsx/regression/6/expected.json +++ b/test/fixtures/jsx/regression/6/expected.json @@ -145,7 +145,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "props" }, "name": "props" } diff --git a/test/fixtures/jsx/regression/issue-2083/expected.json b/test/fixtures/jsx/regression/issue-2083/expected.json index eeb0a95cc9..3f7dd61fd2 100644 --- a/test/fixtures/jsx/regression/issue-2083/expected.json +++ b/test/fixtures/jsx/regression/issue-2083/expected.json @@ -122,7 +122,8 @@ "closingElement": null, "children": [], "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 7 } }, "alternate": { diff --git a/test/utils/runFixtureTests.js b/test/utils/runFixtureTests.js index 99b9787939..723c3051e7 100644 --- a/test/utils/runFixtureTests.js +++ b/test/utils/runFixtureTests.js @@ -49,9 +49,6 @@ exports.runThrowTestsWithEstree = function runThrowTestsWithEstree(fixturesPath, }; function save(test, ast) { - delete ast.tokens; - if (ast.comments && !ast.comments.length) delete ast.comments; - // Ensure that RegExp are serialized as strings const toJSON = RegExp.prototype.toJSON; RegExp.prototype.toJSON = RegExp.prototype.toString; @@ -81,6 +78,9 @@ function runTest(test, parseFunction) { throw err; } + delete ast.tokens; + if (ast.comments && !ast.comments.length) delete ast.comments; + if (!test.expect.code && !opts.throws && !process.env.CI) { test.expect.loc += "on"; return save(test, ast); @@ -129,5 +129,15 @@ function misMatch(exp, act) { var mis = misMatch(exp[prop], act[prop]); if (mis) return addPath(mis, prop); } + + for (var prop in act) { + if (prop === "__clone") { + continue; + } + + if (!(prop in exp) && act[prop] !== undefined) { + return `Did not expect a property '${prop}'`; + } + } } } From 0811438c822df70ff5711833134d61d38909d8c1 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 19 Mar 2017 22:07:16 +0100 Subject: [PATCH 052/105] Update flow (#422) --- package.json | 2 +- yarn.lock | 1275 +++++++++++++++++++++++++------------------------- 2 files changed, 643 insertions(+), 634 deletions(-) diff --git a/package.json b/package.json index 08106714de..eb5642d926 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.20.0", - "flow-bin": "^0.41.0", + "flow-bin": "^0.42.0", "nyc": "^10.0.0", "rimraf": "^2.5.4", "rollup": "^0.41.0", diff --git a/yarn.lock b/yarn.lock index e902f0c7f8..e3c07cc87c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,8 +3,8 @@ abbrev@1: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + version "1.1.0" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" acorn-jsx@^3.0.0: version "3.0.1" @@ -12,21 +12,21 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" +acorn@4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" + acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^4.0.1: - version "4.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" - ajv-keywords@^1.0.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.0.tgz#c11e6859eafff83e0dafc416929472eca946aa2c" + version "1.5.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" -ajv@^4.7.0: - version "4.10.4" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.10.4.tgz#c0974dd00b3464984892d6010aa9c2c945933254" +ajv@^4.7.0, ajv@^4.9.1: + version "4.11.5" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.5.tgz#b6ee74657b993a01dce44b7944d56f485828d5bd" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" @@ -79,8 +79,8 @@ append-transform@^0.4.0: default-require-extensions "^1.0.0" aproba@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0" + version "1.1.1" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab" archy@^1.0.0: version "1.0.0" @@ -147,14 +147,14 @@ asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -163,10 +163,6 @@ async@^1.4.0, async@^1.4.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" -async@~0.2.6: - version "0.2.10" - resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -283,21 +279,21 @@ aws-sign2@~0.6.0: resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" aws4@^1.2.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755" + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" babel-cli@^6.14.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.18.0.tgz#92117f341add9dead90f6fa7d0a97c0cc08ec186" + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.24.0.tgz#a05ffd210dca0c288a26d5319c5ac8669a265ad0" dependencies: - babel-core "^6.18.0" - babel-polyfill "^6.16.0" - babel-register "^6.18.0" - babel-runtime "^6.9.0" + babel-core "^6.24.0" + babel-polyfill "^6.23.0" + babel-register "^6.24.0" + babel-runtime "^6.22.0" commander "^2.8.1" convert-source-map "^1.1.0" fs-readdir-recursive "^1.0.0" - glob "^5.0.5" + glob "^7.0.0" lodash "^4.2.0" output-file-sync "^1.1.0" path-is-absolute "^1.0.0" @@ -305,29 +301,29 @@ babel-cli@^6.14.0: source-map "^0.5.0" v8flags "^2.0.10" optionalDependencies: - chokidar "^1.0.0" + chokidar "^1.6.1" -babel-code-frame@^6.16.0, babel-code-frame@^6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.20.0.tgz#b968f839090f9a8bc6d41938fb96cb84f7387b26" +babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: chalk "^1.1.0" esutils "^2.0.2" - js-tokens "^2.0.0" - -babel-core@6, babel-core@^6.17.0, babel-core@^6.18.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.21.0.tgz#75525480c21c803f826ef3867d22c19f080a3724" - dependencies: - babel-code-frame "^6.20.0" - babel-generator "^6.21.0" - babel-helpers "^6.16.0" - babel-messages "^6.8.0" - babel-register "^6.18.0" - babel-runtime "^6.20.0" - babel-template "^6.16.0" - babel-traverse "^6.21.0" - babel-types "^6.21.0" + js-tokens "^3.0.0" + +babel-core@6, babel-core@^6.17.0, babel-core@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.0.tgz#8f36a0a77f5c155aed6f920b844d23ba56742a02" + dependencies: + babel-code-frame "^6.22.0" + babel-generator "^6.24.0" + babel-helpers "^6.23.0" + babel-messages "^6.23.0" + babel-register "^6.24.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.1" + babel-types "^6.23.0" babylon "^6.11.0" convert-source-map "^1.1.0" debug "^2.1.1" @@ -349,149 +345,150 @@ babel-eslint@^7.0.0: babylon "^6.13.0" lodash.pickby "^4.6.0" -babel-generator@^6.1.0, babel-generator@^6.18.0, babel-generator@^6.21.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.21.0.tgz#605f1269c489a1c75deeca7ea16d43d4656c8494" +babel-generator@^6.1.0, babel-generator@^6.18.0, babel-generator@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.0.tgz#eba270a8cc4ce6e09a61be43465d7c62c1f87c56" dependencies: - babel-messages "^6.8.0" - babel-runtime "^6.20.0" - babel-types "^6.21.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" detect-indent "^4.0.0" jsesc "^1.3.0" lodash "^4.2.0" source-map "^0.5.0" + trim-right "^1.0.1" -babel-helper-bindify-decorators@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.18.0.tgz#fc00c573676a6e702fffa00019580892ec8780a5" +babel-helper-bindify-decorators@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.22.0.tgz#d7f5bc261275941ac62acfc4e20dacfb8a3fe952" dependencies: - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-builder-binary-assignment-operator-visitor@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.18.0.tgz#8ae814989f7a53682152e3401a04fabd0bb333a6" +babel-helper-builder-binary-assignment-operator-visitor@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.22.0.tgz#29df56be144d81bdeac08262bfa41d2c5e91cdcd" dependencies: - babel-helper-explode-assignable-expression "^6.18.0" - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-helper-explode-assignable-expression "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-helper-call-delegate@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.18.0.tgz#05b14aafa430884b034097ef29e9f067ea4133bd" +babel-helper-call-delegate@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz#119921b56120f17e9dae3f74b4f5cc7bcc1b37ef" dependencies: - babel-helper-hoist-variables "^6.18.0" - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-hoist-variables "^6.22.0" + babel-runtime "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-define-map@^6.18.0, babel-helper-define-map@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.18.0.tgz#8d6c85dc7fbb4c19be3de40474d18e97c3676ec2" +babel-helper-define-map@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz#1444f960c9691d69a2ced6a205315f8fd00804e7" dependencies: - babel-helper-function-name "^6.18.0" - babel-runtime "^6.9.0" - babel-types "^6.18.0" + babel-helper-function-name "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" lodash "^4.2.0" -babel-helper-explode-assignable-expression@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.18.0.tgz#14b8e8c2d03ad735d4b20f1840b24cd1f65239fe" +babel-helper-explode-assignable-expression@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.22.0.tgz#c97bf76eed3e0bae4048121f2b9dae1a4e7d0478" dependencies: - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-explode-class@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.18.0.tgz#c44f76f4fa23b9c5d607cbac5d4115e7a76f62cb" +babel-helper-explode-class@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.22.0.tgz#646304924aa6388a516843ba7f1855ef8dfeb69b" dependencies: - babel-helper-bindify-decorators "^6.18.0" - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-bindify-decorators "^6.22.0" + babel-runtime "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" babel-helper-fixtures@^6.9.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-helper-fixtures/-/babel-helper-fixtures-6.20.0.tgz#b794c55077e4d5b969604a98cecad0068a7f16e8" + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-fixtures/-/babel-helper-fixtures-6.22.0.tgz#3cb9eaf5feae29f001d2754ab43b14a9dfa304ff" dependencies: - babel-runtime "^6.20.0" + babel-runtime "^6.22.0" lodash "^4.2.0" try-resolve "^1.0.0" -babel-helper-function-name@^6.18.0, babel-helper-function-name@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.18.0.tgz#68ec71aeba1f3e28b2a6f0730190b754a9bf30e6" +babel-helper-function-name@^6.22.0, babel-helper-function-name@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz#25742d67175c8903dbe4b6cb9d9e1fcb8dcf23a6" dependencies: - babel-helper-get-function-arity "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-get-function-arity "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-helper-get-function-arity@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.18.0.tgz#a5b19695fd3f9cdfc328398b47dafcd7094f9f24" +babel-helper-get-function-arity@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz#0beb464ad69dc7347410ac6ade9f03a50634f5ce" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-helper-hoist-variables@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.18.0.tgz#a835b5ab8b46d6de9babefae4d98ea41e866b82a" +babel-helper-hoist-variables@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz#3eacbf731d80705845dd2e9718f600cfb9b4ba72" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-helper-optimise-call-expression@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.18.0.tgz#9261d0299ee1a4f08a6dd28b7b7c777348fd8f0f" +babel-helper-optimise-call-expression@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz#f3ee7eed355b4282138b33d02b78369e470622f5" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" -babel-helper-regex@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.18.0.tgz#ae0ebfd77de86cb2f1af258e2cc20b5fe893ecc6" +babel-helper-regex@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz#79f532be1647b1f0ee3474b5f5c3da58001d247d" dependencies: - babel-runtime "^6.9.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" lodash "^4.2.0" -babel-helper-remap-async-to-generator@^6.16.0, babel-helper-remap-async-to-generator@^6.16.2: - version "6.20.3" - resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.20.3.tgz#9dd3b396f13e35ef63e538098500adc24c63c4e7" +babel-helper-remap-async-to-generator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.22.0.tgz#2186ae73278ed03b8b15ced089609da981053383" dependencies: - babel-helper-function-name "^6.18.0" - babel-runtime "^6.20.0" - babel-template "^6.16.0" - babel-traverse "^6.20.0" - babel-types "^6.20.0" + babel-helper-function-name "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" + babel-traverse "^6.22.0" + babel-types "^6.22.0" -babel-helper-replace-supers@^6.18.0, babel-helper-replace-supers@^6.8.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.18.0.tgz#28ec69877be4144dbd64f4cc3a337e89f29a924e" +babel-helper-replace-supers@^6.22.0, babel-helper-replace-supers@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz#eeaf8ad9b58ec4337ca94223bacdca1f8d9b4bfd" dependencies: - babel-helper-optimise-call-expression "^6.18.0" - babel-messages "^6.8.0" - babel-runtime "^6.0.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + babel-helper-optimise-call-expression "^6.23.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-helpers@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3" +babel-helpers@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.23.0.tgz#4f8f2e092d0b6a8808a4bde79c27f1e2ecf0d992" dependencies: - babel-runtime "^6.0.0" - babel-template "^6.16.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" -babel-messages@^6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.8.0.tgz#bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9" +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" babel-plugin-ava-throws-helper@^0.1.0: version "0.1.0" @@ -500,11 +497,11 @@ babel-plugin-ava-throws-helper@^0.1.0: babel-template "^6.7.0" babel-types "^6.7.2" -babel-plugin-check-es2015-constants@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.8.0.tgz#dbf024c32ed37bfda8dee1e76da02386a8d26fe7" +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" babel-plugin-detective@^2.0.0: version "2.0.0" @@ -523,10 +520,10 @@ babel-plugin-espower@^2.3.1: estraverse "^4.1.1" babel-plugin-external-helpers@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.18.0.tgz#c6bbf87a4448eb49616f24a8b8088503863488da" + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" babel-plugin-istanbul@^3.0.0: version "3.1.2" @@ -585,290 +582,288 @@ babel-plugin-syntax-object-rest-spread@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" -babel-plugin-syntax-trailing-function-commas@^6.3.13: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.20.0.tgz#442835e19179f45b87e92d477d70b9f1f18b5c4f" +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" -babel-plugin-transform-async-generator-functions@^6.17.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.17.0.tgz#d0b5a2b2f0940f2b245fa20a00519ed7bc6cae54" +babel-plugin-transform-async-generator-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.22.0.tgz#a720a98153a7596f204099cd5409f4b3c05bab46" dependencies: - babel-helper-remap-async-to-generator "^6.16.2" + babel-helper-remap-async-to-generator "^6.22.0" babel-plugin-syntax-async-generators "^6.5.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-async-to-generator@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.16.0.tgz#19ec36cb1486b59f9f468adfa42ce13908ca2999" +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.22.0.tgz#194b6938ec195ad36efc4c33a971acf00d8cd35e" dependencies: - babel-helper-remap-async-to-generator "^6.16.0" + babel-helper-remap-async-to-generator "^6.22.0" babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-class-constructor-call@^6.3.13: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.18.0.tgz#80855e38a1ab47b8c6c647f8ea1bcd2c00ca3aae" +babel-plugin-transform-class-constructor-call@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.22.0.tgz#11a4d2216abb5b0eef298b493748f4f2f4869120" dependencies: babel-plugin-syntax-class-constructor-call "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" -babel-plugin-transform-class-properties@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.19.0.tgz#1274b349abaadc835164e2004f4a2444a2788d5f" +babel-plugin-transform-class-properties@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.23.0.tgz#187b747ee404399013563c993db038f34754ac3b" dependencies: - babel-helper-function-name "^6.18.0" + babel-helper-function-name "^6.23.0" babel-plugin-syntax-class-properties "^6.8.0" - babel-runtime "^6.9.1" - babel-template "^6.15.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" -babel-plugin-transform-decorators@^6.13.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.13.0.tgz#82d65c1470ae83e2d13eebecb0a1c2476d62da9d" +babel-plugin-transform-decorators@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.22.0.tgz#c03635b27a23b23b7224f49232c237a73988d27c" dependencies: - babel-helper-define-map "^6.8.0" - babel-helper-explode-class "^6.8.0" + babel-helper-explode-class "^6.22.0" babel-plugin-syntax-decorators "^6.13.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" - babel-types "^6.13.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-do-expressions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.8.0.tgz#fda692af339835cc255bb7544efb8f7c1306c273" +babel-plugin-transform-do-expressions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb" dependencies: babel-plugin-syntax-do-expressions "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-arrow-functions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.8.0.tgz#5b63afc3181bdc9a8c4d481b5a4f3f7d7fef3d9d" +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoped-functions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.8.0.tgz#ed95d629c4b5a71ae29682b998f70d9833eb366d" +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoping@^6.18.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.21.0.tgz#e840687f922e70fb2c42bb13501838c174a115ed" +babel-plugin-transform-es2015-block-scoping@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz#e48895cf0b375be148cd7c8879b422707a053b51" dependencies: - babel-runtime "^6.20.0" - babel-template "^6.15.0" - babel-traverse "^6.21.0" - babel-types "^6.21.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" lodash "^4.2.0" -babel-plugin-transform-es2015-classes@^6.18.0, babel-plugin-transform-es2015-classes@^6.9.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.18.0.tgz#ffe7a17321bf83e494dcda0ae3fc72df48ffd1d9" - dependencies: - babel-helper-define-map "^6.18.0" - babel-helper-function-name "^6.18.0" - babel-helper-optimise-call-expression "^6.18.0" - babel-helper-replace-supers "^6.18.0" - babel-messages "^6.8.0" - babel-runtime "^6.9.0" - babel-template "^6.14.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" +babel-plugin-transform-es2015-classes@^6.22.0, babel-plugin-transform-es2015-classes@^6.9.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz#49b53f326202a2fd1b3bbaa5e2edd8a4f78643c1" + dependencies: + babel-helper-define-map "^6.23.0" + babel-helper-function-name "^6.23.0" + babel-helper-optimise-call-expression "^6.23.0" + babel-helper-replace-supers "^6.23.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-plugin-transform-es2015-computed-properties@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.8.0.tgz#f51010fd61b3bd7b6b60a5fdfd307bb7a5279870" +babel-plugin-transform-es2015-computed-properties@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz#7c383e9629bba4820c11b0425bdd6290f7f057e7" dependencies: - babel-helper-define-map "^6.8.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" -babel-plugin-transform-es2015-destructuring@^6.18.0, babel-plugin-transform-es2015-destructuring@^6.6.5: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.19.0.tgz#ff1d911c4b3f4cab621bd66702a869acd1900533" +babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.6.5: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" dependencies: - babel-runtime "^6.9.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-duplicate-keys@^6.6.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.8.0.tgz#fd8f7f7171fc108cc1c70c3164b9f15a81c25f7d" +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz#672397031c21610d72dd2bbb0ba9fb6277e1c36b" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.8.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-for-of@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.18.0.tgz#4c517504db64bf8cfc119a6b8f177211f2028a70" +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-function-name@^6.5.0, babel-plugin-transform-es2015-function-name@^6.9.0: - version "6.9.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.9.0.tgz#8c135b17dbd064e5bba56ec511baaee2fca82719" +babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.5.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz#f5fcc8b09093f9a23c76ac3d9e392c3ec4b77104" dependencies: - babel-helper-function-name "^6.8.0" - babel-runtime "^6.9.0" - babel-types "^6.9.0" + babel-helper-function-name "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-literals@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.8.0.tgz#50aa2e5c7958fc2ab25d74ec117e0cc98f046468" +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-modules-amd@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.18.0.tgz#49a054cbb762bdf9ae2d8a807076cfade6141e40" +babel-plugin-transform-es2015-modules-amd@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.0.tgz#a1911fb9b7ec7e05a43a63c5995007557bcf6a2e" dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-plugin-transform-es2015-modules-commonjs "^6.24.0" + babel-runtime "^6.22.0" + babel-template "^6.22.0" -babel-plugin-transform-es2015-modules-commonjs@^6.18.0, babel-plugin-transform-es2015-modules-commonjs@^6.7.4: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.18.0.tgz#c15ae5bb11b32a0abdcc98a5837baa4ee8d67bcc" +babel-plugin-transform-es2015-modules-commonjs@^6.24.0, babel-plugin-transform-es2015-modules-commonjs@^6.7.4: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.0.tgz#e921aefb72c2cc26cb03d107626156413222134f" dependencies: - babel-plugin-transform-strict-mode "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.16.0" - babel-types "^6.18.0" + babel-plugin-transform-strict-mode "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-types "^6.23.0" -babel-plugin-transform-es2015-modules-systemjs@^6.18.0: - version "6.19.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.19.0.tgz#50438136eba74527efa00a5b0fefaf1dc4071da6" +babel-plugin-transform-es2015-modules-systemjs@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz#ae3469227ffac39b0310d90fec73bfdc4f6317b0" dependencies: - babel-helper-hoist-variables "^6.18.0" - babel-runtime "^6.11.6" - babel-template "^6.14.0" + babel-helper-hoist-variables "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" -babel-plugin-transform-es2015-modules-umd@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.18.0.tgz#23351770ece5c1f8e83ed67cb1d7992884491e50" +babel-plugin-transform-es2015-modules-umd@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.0.tgz#fd5fa63521cae8d273927c3958afd7c067733450" dependencies: - babel-plugin-transform-es2015-modules-amd "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-plugin-transform-es2015-modules-amd "^6.24.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" -babel-plugin-transform-es2015-object-super@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.8.0.tgz#1b858740a5a4400887c23dcff6f4d56eea4a24c5" +babel-plugin-transform-es2015-object-super@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz#daa60e114a042ea769dd53fe528fc82311eb98fc" dependencies: - babel-helper-replace-supers "^6.8.0" - babel-runtime "^6.0.0" + babel-helper-replace-supers "^6.22.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-parameters@^6.18.0, babel-plugin-transform-es2015-parameters@^6.7.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.21.0.tgz#46a655e6864ef984091448cdf024d87b60b2a7d8" +babel-plugin-transform-es2015-parameters@^6.22.0, babel-plugin-transform-es2015-parameters@^6.7.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz#3a2aabb70c8af945d5ce386f1a4250625a83ae3b" dependencies: - babel-helper-call-delegate "^6.18.0" - babel-helper-get-function-arity "^6.18.0" - babel-runtime "^6.9.0" - babel-template "^6.16.0" - babel-traverse "^6.21.0" - babel-types "^6.21.0" + babel-helper-call-delegate "^6.22.0" + babel-helper-get-function-arity "^6.22.0" + babel-runtime "^6.22.0" + babel-template "^6.23.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" -babel-plugin-transform-es2015-shorthand-properties@^6.18.0, babel-plugin-transform-es2015-shorthand-properties@^6.5.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.18.0.tgz#e2ede3b7df47bf980151926534d1dd0cbea58f43" +babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.5.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz#8ba776e0affaa60bff21e921403b8a652a2ff723" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-spread@^6.3.13, babel-plugin-transform-es2015-spread@^6.6.5: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.8.0.tgz#0217f737e3b821fa5a669f187c6ed59205f05e9c" +babel-plugin-transform-es2015-spread@^6.22.0, babel-plugin-transform-es2015-spread@^6.6.5: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-sticky-regex@^6.3.13, babel-plugin-transform-es2015-sticky-regex@^6.5.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.8.0.tgz#e73d300a440a35d5c64f5c2a344dc236e3df47be" +babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.5.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz#ab316829e866ee3f4b9eb96939757d19a5bc4593" dependencies: - babel-helper-regex "^6.8.0" - babel-runtime "^6.0.0" - babel-types "^6.8.0" + babel-helper-regex "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-plugin-transform-es2015-template-literals@^6.6.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.8.0.tgz#86eb876d0a2c635da4ec048b4f7de9dfc897e66b" +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-typeof-symbol@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.18.0.tgz#0b14c48629c90ff47a0650077f6aa699bee35798" +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-es2015-unicode-regex@^6.3.13, babel-plugin-transform-es2015-unicode-regex@^6.5.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.11.0.tgz#6298ceabaad88d50a3f4f392d8de997260f6ef2c" +babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.5.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz#8d9cc27e7ee1decfe65454fb986452a04a613d20" dependencies: - babel-helper-regex "^6.8.0" - babel-runtime "^6.0.0" + babel-helper-regex "^6.22.0" + babel-runtime "^6.22.0" regexpu-core "^2.0.0" -babel-plugin-transform-exponentiation-operator@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.8.0.tgz#db25742e9339eade676ca9acec46f955599a68a4" +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.22.0.tgz#d57c8335281918e54ef053118ce6eb108468084d" dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.8.0" + babel-helper-builder-binary-assignment-operator-visitor "^6.22.0" babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-export-extensions@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.8.0.tgz#fa80ff655b636549431bfd38f6b817bd82e47f5b" +babel-plugin-transform-export-extensions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653" dependencies: babel-plugin-syntax-export-extensions "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" babel-plugin-transform-flow-strip-types@^6.14.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.21.0.tgz#2eea3f8b5bb234339b47283feac155cfb237b948" + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" dependencies: babel-plugin-syntax-flow "^6.18.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-function-bind@^6.3.13: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.8.0.tgz#e7f334ce69f50d28fe850a822eaaab9fa4f4d821" +babel-plugin-transform-function-bind@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz#c6fb8e96ac296a310b8cf8ea401462407ddf6a97" dependencies: babel-plugin-syntax-function-bind "^6.8.0" - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-plugin-transform-object-rest-spread@^6.16.0: - version "6.20.2" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.20.2.tgz#e816c55bba77b14c16365d87e2ae48c8fd18fc2e" +babel-plugin-transform-object-rest-spread@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" dependencies: babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.20.0" + babel-runtime "^6.22.0" -babel-plugin-transform-regenerator@^6.16.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.21.0.tgz#75d0c7e7f84f379358f508451c68a2c5fa5a9703" +babel-plugin-transform-regenerator@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz#65740593a319c44522157538d690b84094617ea6" dependencies: regenerator-transform "0.9.8" babel-plugin-transform-runtime@^6.15.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.15.0.tgz#3d75b4d949ad81af157570273846fb59aeb0d57c" + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz#88490d446502ea9b8e7efb0fe09ec4d99479b1ee" dependencies: - babel-runtime "^6.9.0" + babel-runtime "^6.22.0" -babel-plugin-transform-strict-mode@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.18.0.tgz#df7cf2991fe046f44163dcd110d5ca43bc652b9d" +babel-plugin-transform-strict-mode@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.22.0.tgz#e008df01340fdc87e959da65991b7e05970c8c7c" dependencies: - babel-runtime "^6.0.0" - babel-types "^6.18.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" -babel-polyfill@^6.16.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.20.0.tgz#de4a371006139e20990aac0be367d398331204e7" +babel-polyfill@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" dependencies: - babel-runtime "^6.20.0" + babel-runtime "^6.22.0" core-js "^2.4.0" regenerator-runtime "^0.10.0" @@ -886,132 +881,132 @@ babel-preset-es2015-node4@^2.1.0: babel-plugin-transform-es2015-unicode-regex "^6.5.0" babel-preset-es2015@^6.14.0, babel-preset-es2015@^6.16.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.18.0.tgz#b8c70df84ec948c43dcf2bf770e988eb7da88312" - dependencies: - babel-plugin-check-es2015-constants "^6.3.13" - babel-plugin-transform-es2015-arrow-functions "^6.3.13" - babel-plugin-transform-es2015-block-scoped-functions "^6.3.13" - babel-plugin-transform-es2015-block-scoping "^6.18.0" - babel-plugin-transform-es2015-classes "^6.18.0" - babel-plugin-transform-es2015-computed-properties "^6.3.13" - babel-plugin-transform-es2015-destructuring "^6.18.0" - babel-plugin-transform-es2015-duplicate-keys "^6.6.0" - babel-plugin-transform-es2015-for-of "^6.18.0" - babel-plugin-transform-es2015-function-name "^6.9.0" - babel-plugin-transform-es2015-literals "^6.3.13" - babel-plugin-transform-es2015-modules-amd "^6.18.0" - babel-plugin-transform-es2015-modules-commonjs "^6.18.0" - babel-plugin-transform-es2015-modules-systemjs "^6.18.0" - babel-plugin-transform-es2015-modules-umd "^6.18.0" - babel-plugin-transform-es2015-object-super "^6.3.13" - babel-plugin-transform-es2015-parameters "^6.18.0" - babel-plugin-transform-es2015-shorthand-properties "^6.18.0" - babel-plugin-transform-es2015-spread "^6.3.13" - babel-plugin-transform-es2015-sticky-regex "^6.3.13" - babel-plugin-transform-es2015-template-literals "^6.6.0" - babel-plugin-transform-es2015-typeof-symbol "^6.18.0" - babel-plugin-transform-es2015-unicode-regex "^6.3.13" - babel-plugin-transform-regenerator "^6.16.0" + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.0.tgz#c162d68b1932696e036cd3110dc1ccd303d2673a" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.22.0" + babel-plugin-transform-es2015-classes "^6.22.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.22.0" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.0" + babel-plugin-transform-es2015-modules-commonjs "^6.24.0" + babel-plugin-transform-es2015-modules-systemjs "^6.22.0" + babel-plugin-transform-es2015-modules-umd "^6.24.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.22.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" babel-preset-stage-0@^6.5.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.16.0.tgz#f5a263c420532fd57491f1a7315b3036e428f823" + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.22.0.tgz#707eeb5b415da769eff9c42f4547f644f9296ef9" dependencies: - babel-plugin-transform-do-expressions "^6.3.13" - babel-plugin-transform-function-bind "^6.3.13" - babel-preset-stage-1 "^6.16.0" + babel-plugin-transform-do-expressions "^6.22.0" + babel-plugin-transform-function-bind "^6.22.0" + babel-preset-stage-1 "^6.22.0" -babel-preset-stage-1@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.16.0.tgz#9d31fbbdae7b17c549fd3ac93e3cf6902695e479" +babel-preset-stage-1@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.22.0.tgz#7da05bffea6ad5a10aef93e320cfc6dd465dbc1a" dependencies: - babel-plugin-transform-class-constructor-call "^6.3.13" - babel-plugin-transform-export-extensions "^6.3.13" - babel-preset-stage-2 "^6.16.0" + babel-plugin-transform-class-constructor-call "^6.22.0" + babel-plugin-transform-export-extensions "^6.22.0" + babel-preset-stage-2 "^6.22.0" -babel-preset-stage-2@^6.16.0, babel-preset-stage-2@^6.17.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.18.0.tgz#9eb7bf9a8e91c68260d5ba7500493caaada4b5b5" +babel-preset-stage-2@^6.17.0, babel-preset-stage-2@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.22.0.tgz#ccd565f19c245cade394b21216df704a73b27c07" dependencies: babel-plugin-syntax-dynamic-import "^6.18.0" - babel-plugin-transform-class-properties "^6.18.0" - babel-plugin-transform-decorators "^6.13.0" - babel-preset-stage-3 "^6.17.0" - -babel-preset-stage-3@^6.17.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.17.0.tgz#b6638e46db6e91e3f889013d8ce143917c685e39" - dependencies: - babel-plugin-syntax-trailing-function-commas "^6.3.13" - babel-plugin-transform-async-generator-functions "^6.17.0" - babel-plugin-transform-async-to-generator "^6.16.0" - babel-plugin-transform-exponentiation-operator "^6.3.13" - babel-plugin-transform-object-rest-spread "^6.16.0" - -babel-register@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.18.0.tgz#892e2e03865078dd90ad2c715111ec4449b32a68" - dependencies: - babel-core "^6.18.0" - babel-runtime "^6.11.6" + babel-plugin-transform-class-properties "^6.22.0" + babel-plugin-transform-decorators "^6.22.0" + babel-preset-stage-3 "^6.22.0" + +babel-preset-stage-3@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.22.0.tgz#a4e92bbace7456fafdf651d7a7657ee0bbca9c2e" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-generator-functions "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-object-rest-spread "^6.22.0" + +babel-register@^6.24.0: + version "6.24.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.0.tgz#5e89f8463ba9970356d02eb07dabe3308b080cfd" + dependencies: + babel-core "^6.24.0" + babel-runtime "^6.22.0" core-js "^2.4.0" home-or-tmp "^2.0.0" lodash "^4.2.0" mkdirp "^0.5.1" source-map-support "^0.4.2" -babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.20.0, babel-runtime@^6.9.0, babel-runtime@^6.9.1: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.20.0.tgz#87300bdcf4cd770f09bf0048c64204e17806d16f" +babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-template@^6.7.0, babel-template@^6.8.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.16.0.tgz#e149dd1a9f03a35f817ddbc4d0481988e7ebc8ca" +babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.23.0, babel-template@^6.7.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638" dependencies: - babel-runtime "^6.9.0" - babel-traverse "^6.16.0" - babel-types "^6.16.0" + babel-runtime "^6.22.0" + babel-traverse "^6.23.0" + babel-types "^6.23.0" babylon "^6.11.0" lodash "^4.2.0" -babel-traverse@^6.15.0, babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.20.0, babel-traverse@^6.21.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.21.0.tgz#69c6365804f1a4f69eb1213f85b00a818b8c21ad" +babel-traverse@^6.15.0, babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1: + version "6.23.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" dependencies: - babel-code-frame "^6.20.0" - babel-messages "^6.8.0" - babel-runtime "^6.20.0" - babel-types "^6.21.0" - babylon "^6.11.0" + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" + babylon "^6.15.0" debug "^2.2.0" globals "^9.0.0" invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.13.0, babel-types@^6.15.0, babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.20.0, babel-types@^6.21.0, babel-types@^6.7.2, babel-types@^6.8.0, babel-types@^6.9.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.21.0.tgz#314b92168891ef6d3806b7f7a917fdf87c11a4b2" +babel-types@^6.15.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0, babel-types@^6.7.2: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" dependencies: - babel-runtime "^6.20.0" + babel-runtime "^6.22.0" esutils "^2.0.2" lodash "^4.2.0" to-fast-properties "^1.0.1" -babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" +babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: + version "6.16.1" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" bcrypt-pbkdf@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz#3ca76b85241c7170bf7d9703e7b9aa74630040d4" + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" dependencies: tweetnacl "^0.14.3" @@ -1026,8 +1021,8 @@ block-stream@*: inherits "~2.0.0" bluebird@^3.0.0, bluebird@^3.4.1: - version "3.4.7" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" + version "3.5.0" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" boom@2.x.x: version "2.10.1" @@ -1136,9 +1131,9 @@ capture-stack-trace@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" center-align@^0.1.1: version "0.1.3" @@ -1165,7 +1160,7 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chokidar@^1.0.0, chokidar@^1.4.2: +chokidar@^1.4.2, chokidar@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" dependencies: @@ -1262,7 +1257,7 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" -commander@^2.8.1, commander@^2.9.0: +commander@^2.8.1: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: @@ -1280,7 +1275,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.4.6: +concat-stream@^1.5.2: version "1.6.0" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: @@ -1307,8 +1302,8 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" convert-source-map@^1.1.0, convert-source-map@^1.2.0, convert-source-map@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67" + version "1.4.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.4.0.tgz#e3dad195bf61bfe13a7a3c73e9876ec14a0268f3" core-assert@^0.2.0: version "0.2.1" @@ -1364,11 +1359,11 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" -d@^0.1.1, d@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" dependencies: - es5-ext "~0.10.2" + es5-ext "^0.10.9" dashdash@^1.12.0: version "1.14.1" @@ -1385,8 +1380,8 @@ debug-log@^1.0.1: resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" debug@^2.1.1, debug@^2.2.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" + version "2.6.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" dependencies: ms "0.7.2" @@ -1444,9 +1439,9 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" -doctrine@^1.2.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" +doctrine@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" dependencies: esutils "^2.0.2" isarray "^1.0.0" @@ -1481,62 +1476,62 @@ empower-core@^0.6.1: core-js "^2.0.0" error-ex@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: is-arrayish "^0.2.1" -es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7: - version "0.10.12" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047" +es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.14" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.14.tgz#625bc9ab9cac0f6fb9dc271525823d1800b3d360" dependencies: es6-iterator "2" es6-symbol "~3.1" -es6-iterator@2: - version "2.0.0" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac" +es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" dependencies: - d "^0.1.1" - es5-ext "^0.10.7" - es6-symbol "3" + d "1" + es5-ext "^0.10.14" + es6-symbol "^3.1" es6-map@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.4.tgz#a34b147be224773a4d7da8072794cefa3632b897" + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - es6-iterator "2" - es6-set "~0.1.3" - es6-symbol "~3.1.0" - event-emitter "~0.3.4" + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" -es6-set@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8" +es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - es6-iterator "2" - es6-symbol "3" - event-emitter "~0.3.4" + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" -es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" +es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" dependencies: - d "~0.1.1" - es5-ext "~0.10.11" + d "1" + es5-ext "~0.10.14" es6-weak-map@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81" + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" dependencies: - d "^0.1.1" - es5-ext "^0.10.8" - es6-iterator "2" - es6-symbol "3" + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.4, escape-string-regexp@^1.0.5: version "1.0.5" @@ -1556,22 +1551,23 @@ eslint-config-babel@^6.0.0: resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-6.0.0.tgz#66feedf6ce6e04abe585cec1a65b5bcc96bed50a" eslint-plugin-flowtype@^2.20.0: - version "2.30.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.0.tgz#3054a265f9c8afe3046c3d41b72d32a736f9b4ae" + version "2.30.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.3.tgz#57835d2c0ed388da7a2725803ec32af2f437c301" dependencies: lodash "^4.15.0" eslint@^3.7.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.13.1.tgz#564d2646b5efded85df96985332edd91a23bff25" + version "3.18.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.18.0.tgz#647e985c4ae71502d20ac62c109f66d5104c8a4b" dependencies: babel-code-frame "^6.16.0" chalk "^1.1.3" - concat-stream "^1.4.6" + concat-stream "^1.5.2" debug "^2.1.1" - doctrine "^1.2.2" + doctrine "^2.0.0" escope "^3.6.0" - espree "^3.3.1" + espree "^3.4.0" + esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" @@ -1609,23 +1605,29 @@ espower-location-detector@^1.0.0: source-map "^0.5.0" xtend "^4.0.0" -espree@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.3.2.tgz#dbf3fadeb4ecb4d4778303e50103b3d36c88b89c" +espree@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d" dependencies: - acorn "^4.0.1" + acorn "4.0.4" acorn-jsx "^3.0.0" -esprima@^2.6.0: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" +esprima@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" espurify@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.6.0.tgz#6cb993582d9422bd6f2d4b258aadb14833f394f0" + version "1.7.0" + resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.7.0.tgz#1c5cf6cbccc32e6f639380bd4f991fab9ba9d226" dependencies: core-js "^2.0.0" +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + esrecurse@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" @@ -1649,12 +1651,12 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -event-emitter@~0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5" +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" dependencies: - d "~0.1.1" - es5-ext "~0.10.7" + d "1" + es5-ext "~0.10.14" execSync@1.0.2: version "1.0.2" @@ -1752,23 +1754,23 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.41.0: - version "0.41.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.41.0.tgz#8badac9a19da45004997e599bd316518db489b2e" +flow-bin@^0.42.0: + version "0.42.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.42.0.tgz#05dd754b6b052de7b150f9210e2160746961e3cf" fn-name@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" -for-in@^0.1.5: - version "0.1.6" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" for-own@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.4.tgz#0149b41a39088c7515f51ebe1c1386d45f935072" + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" dependencies: - for-in "^0.1.5" + for-in "^1.0.1" foreground-child@^1.3.3, foreground-child@^1.5.3: version "1.5.6" @@ -1798,8 +1800,8 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" fsevents@^1.0.0: - version "1.0.17" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.0.17.tgz#8537f3f12272678765b4fd6528c0f1f66f8f4558" + version "1.1.1" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.1.tgz#f19fd28f43eeaf761680e519a203c4d0b3d31aff" dependencies: nan "^2.3.0" node-pre-gyp "^0.6.29" @@ -1813,8 +1815,8 @@ fstream-ignore@~1.0.5: minimatch "^3.0.0" fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.10.tgz#604e8a92fe26ffd9f6fae30399d4984e1ab22822" + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -1822,8 +1824,8 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: rimraf "2" gauge@~2.7.1: - version "2.7.2" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.2.tgz#15cecc31b02d05345a5d6b0e171cdb3ad2307774" + version "2.7.3" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09" dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -1832,7 +1834,6 @@ gauge@~2.7.1: signal-exit "^3.0.0" string-width "^1.0.1" strip-ansi "^3.0.1" - supports-color "^0.2.0" wide-align "^1.1.0" generate-function@^2.0.0: @@ -1878,16 +1879,6 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@^5.0.5: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" @@ -1900,8 +1891,8 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6: path-is-absolute "^1.0.0" globals@^9.0.0, globals@^9.14.0: - version "9.14.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" + version "9.16.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80" globby@^5.0.0: version "5.0.0" @@ -1966,14 +1957,16 @@ handlebars@^4.0.3: optionalDependencies: uglify-js "^2.6" -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" + ajv "^4.9.1" + har-schema "^1.0.5" has-ansi@^2.0.0: version "2.0.0" @@ -2018,8 +2011,8 @@ home-or-tmp@^2.0.0: os-tmpdir "^1.0.1" hosted-git-info@^2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" + version "2.3.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.3.1.tgz#ac439421605f0beb0ea1349de7d8bb28e50be1dd" http-signature@~1.1.0: version "1.1.1" @@ -2034,8 +2027,8 @@ ignore-by-default@^1.0.0, ignore-by-default@^1.0.1: resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" ignore@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.0.tgz#8d88f03c3002a0ac52114db25d2c673b0bf1e435" + version "3.2.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.6.tgz#26e8da0644be0bb4cb39516f6c79f0e0f4ffe48c" imurmurhash@^0.1.4: version "0.1.4" @@ -2109,8 +2102,8 @@ is-binary-path@^1.0.0: binary-extensions "^1.0.0" is-buffer@^1.0.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" is-builtin-module@^1.0.0: version "1.0.0" @@ -2172,9 +2165,9 @@ is-glob@^2.0.0, is-glob@^2.0.1: dependencies: is-extglob "^1.0.0" -is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: - version "2.15.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" +is-my-json-valid@^2.10.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" dependencies: generate-function "^2.0.0" generate-object-property "^1.1.0" @@ -2328,8 +2321,8 @@ istanbul-lib-source-maps@^1.1.0: source-map "^0.5.3" istanbul-reports@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.0.tgz#24b4eb2b1d29d50f103b369bd422f6e640aa0777" + version "1.0.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.1.tgz#9a17176bc4a6cbebdae52b2f15961d52fa623fbc" dependencies: handlebars "^4.0.3" @@ -2339,24 +2332,20 @@ jodid25519@^1.0.0: dependencies: jsbn "~0.1.0" -js-tokens@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" - js-tokens@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.0.tgz#a2f2a969caae142fb3cd56228358c89366957bd1" + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" js-yaml@^3.5.1: - version "3.7.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" + version "3.8.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.2.tgz#02d3e2c0f6beab20248d412c352203827d786721" dependencies: argparse "^1.0.7" - esprima "^2.6.0" + esprima "^3.1.1" jsbn@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" jsesc@^1.3.0: version "1.3.0" @@ -2393,9 +2382,10 @@ jsonpointer@^4.0.0: resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" jsprim@^1.2.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.3.1.tgz#2a7256f70412a29ee3670aaca625994c4dcff252" + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" dependencies: + assert-plus "1.0.0" extsprintf "1.0.2" json-schema "0.2.3" verror "1.3.6" @@ -2633,7 +2623,7 @@ mime-types@^2.1.12, mime-types@~2.1.7: dependencies: mime-db "~1.26.0" -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2: +minimatch@^3.0.0, minimatch@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: @@ -2657,10 +2647,14 @@ ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" -ms@0.7.2, ms@^0.7.1: +ms@0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" +ms@^0.7.1: + version "0.7.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" + multimatch@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" @@ -2675,16 +2669,16 @@ mute-stream@0.0.5: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" nan@^2.3.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.0.tgz#aa8f1e34531d807e9e27755b234b4a6ec0c152a8" + version "2.5.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2" natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" node-pre-gyp@^0.6.29: - version "0.6.32" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.32.tgz#fc452b376e7319b3d255f5f34853ef6fd8fe1fd5" + version "0.6.33" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz#640ac55198f6a925972e0c16c4ac26a034d5ecc9" dependencies: mkdirp "~0.5.1" nopt "~3.0.6" @@ -2707,8 +2701,8 @@ nopt@~3.0.6: abbrev "1" normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: - version "2.3.5" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df" + version "2.3.6" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.6.tgz#498fa420c96401f787402ba21e600def9f981fff" dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -2919,6 +2913,10 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -3046,8 +3044,8 @@ pretty-ms@^2.0.0: plur "^1.0.0" private@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1" + version "0.1.7" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" process-nextick-args@~1.0.6: version "1.0.7" @@ -3065,9 +3063,9 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -qs@~6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" randomatic@^1.1.3: version "1.1.6" @@ -3077,13 +3075,13 @@ randomatic@^1.1.3: kind-of "^3.0.2" rc@^1.0.1, rc@^1.1.6, rc@~1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" + version "1.1.7" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.7.tgz#c5ea564bb07aff9fd3a5b32e906c1d3a65940fea" dependencies: deep-extend "~0.4.0" ini "~1.3.0" minimist "^1.2.0" - strip-json-comments "~1.0.4" + strip-json-comments "~2.0.1" read-all-stream@^3.0.0: version "3.1.0" @@ -3108,8 +3106,8 @@ read-pkg@^1.0.0: path-type "^1.0.0" readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" + version "2.2.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.6.tgz#8b43aed76e71483938d12a8d46c6cf1a00b1f816" dependencies: buffer-shims "^1.0.0" core-util-is "~1.0.0" @@ -3166,8 +3164,8 @@ regenerate@^1.2.1: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" regenerator-runtime@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb" + version "0.10.3" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" regenerator-transform@0.9.8: version "0.9.8" @@ -3229,17 +3227,17 @@ repeating@^2.0.0: is-finite "^1.0.0" request@>=2.42.0, request@^2.79.0: - version "2.79.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: aws-sign2 "~0.6.0" aws4 "^1.2.1" - caseless "~0.11.0" + caseless "~0.12.0" combined-stream "~1.0.5" extend "~3.0.0" forever-agent "~0.6.1" form-data "~2.1.1" - har-validator "~2.0.6" + har-validator "~4.2.1" hawk "~3.1.3" http-signature "~1.1.0" is-typedarray "~1.0.0" @@ -3247,10 +3245,12 @@ request@>=2.42.0, request@^2.79.0: json-stringify-safe "~5.0.1" mime-types "~2.1.7" oauth-sign "~0.8.1" - qs "~6.3.0" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" stringstream "~0.0.4" tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" + tunnel-agent "^0.6.0" uuid "^3.0.0" require-directory@^2.1.1: @@ -3295,8 +3295,10 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" resolve@^1.1.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" + version "1.3.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235" + dependencies: + path-parse "^1.0.5" restore-cursor@^1.0.1: version "1.0.1" @@ -3311,9 +3313,9 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@^2.5.4, rimraf@~2.5.1, rimraf@~2.5.4: - version "2.5.4" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@^2.5.4: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: glob "^7.0.5" @@ -3323,6 +3325,12 @@ rimraf@~2.1.4: optionalDependencies: graceful-fs "~1" +rimraf@~2.5.1, rimraf@~2.5.4: + version "2.5.4" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" + dependencies: + glob "^7.0.5" + rollup-plugin-babel@^2.6.1: version "2.7.1" resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" @@ -3354,8 +3362,8 @@ rollup-watch@^3.2.2: require-relative "0.8.7" rollup@^0.41.0: - version "0.41.4" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.4.tgz#a970580176329f9ead86854d7fd4c46de752aef8" + version "0.41.6" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" dependencies: source-map-support "^0.4.0" @@ -3369,6 +3377,10 @@ rx-lite@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" +safe-buffer@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + semver-diff@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" @@ -3388,8 +3400,8 @@ set-immediate-shim@^1.0.1: resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" shelljs@^0.7.5: - version "0.7.6" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad" + version "0.7.7" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -3428,10 +3440,10 @@ sort-keys@^1.1.1: is-plain-obj "^1.0.0" source-map-support@^0.4.0, source-map-support@^0.4.2: - version "0.4.10" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.10.tgz#d7b19038040a14c0837a18e630a196453952b378" + version "0.4.14" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.14.tgz#9d4463772598b86271b4f523f6c1f4e02a7d6aef" dependencies: - source-map "^0.5.3" + source-map "^0.5.6" source-map@^0.4.4: version "0.4.4" @@ -3439,7 +3451,7 @@ source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.3, source-map@~0.5.1: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -3473,8 +3485,8 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" sshpk@^1.7.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.2.tgz#d5a804ce22695515638e798dbe23273de070a5fa" + version "1.11.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.11.0.tgz#2d8d5ebb4a6fab28ffba37fa62a90f4a3ea59d77" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -3548,18 +3560,10 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" - strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -supports-color@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -3676,6 +3680,10 @@ trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + try-resolve@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/try-resolve/-/try-resolve-1.0.1.tgz#cfde6fabd72d63e5797cfaab873abbe8e700e912" @@ -3684,9 +3692,11 @@ tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" @@ -3707,10 +3717,9 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" uglify-js@^2.6: - version "2.7.5" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8" + version "2.8.14" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.14.tgz#25b15d1af39b21752ee33703adbf432e8bc8f77d" dependencies: - async "~0.2.6" source-map "~0.5.1" uglify-to-browserify "~1.0.0" yargs "~3.10.0" @@ -3903,8 +3912,8 @@ y18n@^3.2.1: resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" yallist@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.0.0.tgz#306c543835f09ee1a4cb23b7bce9ab341c91cdd4" + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" yargs-parser@^4.0.2, yargs-parser@^4.2.0: version "4.2.1" From 6a94d0eb9c4fd27916f7ebbe8f8b3fee35fdbd37 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 21 Mar 2017 15:56:16 -0400 Subject: [PATCH 053/105] 7.0.0-beta.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 50602a7345..6ad0f5431e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "7.0.0-beta.4", + "version": "7.0.0-beta.5", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 5f048b4f5dff6417e2f0bd32803239eef97821b2 Mon Sep 17 00:00:00 2001 From: James Browning Date: Wed, 22 Mar 2017 09:44:55 +1300 Subject: [PATCH 054/105] [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] --- ast/spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ast/spec.md b/ast/spec.md index c004ac452c..c03bfad24f 100644 --- a/ast/spec.md +++ b/ast/spec.md @@ -669,7 +669,6 @@ An object expression. interface ObjectMember <: Node { key: Expression; computed: boolean; - value: Expression; decorators: [ Decorator ]; } ``` @@ -680,6 +679,7 @@ interface ObjectMember <: Node { interface ObjectProperty <: ObjectMember { type: "ObjectProperty"; shorthand: boolean; + value: Expression; } ``` From fab343e379a51cb6d0bc84d743838c0827689ba9 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 22 Mar 2017 09:50:34 +1300 Subject: [PATCH 055/105] Add support for invalid escapes in tagged templates (#274) Per the stage-3 TC39 proposal: https://github.com/tc39/proposal-template-literal-revision --- README.md | 1 + ast/spec.md | 2 +- src/parser/expression.js | 19 +- src/tokenizer/index.js | 71 +++++-- src/tokenizer/state.js | 2 + .../core/uncategorised/499/options.json | 2 +- .../core/uncategorised/501/options.json | 2 +- .../core/uncategorised/503/options.json | 2 +- .../es2015/uncategorised/290/options.json | 2 +- .../es2015/uncategorised/339/options.json | 2 +- .../invalid-escape/options.json | 2 +- .../invalid-syntax/migrated_0216/options.json | 2 +- .../invalid-syntax/migrated_0217/options.json | 2 +- .../invalid-syntax/migrated_0219/options.json | 2 +- .../invalid-syntax/migrated_0221/options.json | 2 +- .../invalid-syntax/migrated_0222/options.json | 2 +- .../invalid-syntax/migrated_0223/options.json | 2 +- .../1/actual.js | 1 + .../1/expected.json | 119 +++++++++++ .../10/actual.js | 1 + .../10/expected.json | 160 ++++++++++++++ .../11/actual.js | 1 + .../11/expected.json | 160 ++++++++++++++ .../12/actual.js | 1 + .../12/expected.json | 200 ++++++++++++++++++ .../13/actual.js | 1 + .../13/expected.json | 119 +++++++++++ .../14/actual.js | 1 + .../14/expected.json | 160 ++++++++++++++ .../15/actual.js | 1 + .../15/expected.json | 160 ++++++++++++++ .../16/actual.js | 1 + .../16/expected.json | 200 ++++++++++++++++++ .../17/actual.js | 1 + .../17/expected.json | 119 +++++++++++ .../18/actual.js | 1 + .../18/expected.json | 160 ++++++++++++++ .../19/actual.js | 1 + .../19/expected.json | 160 ++++++++++++++ .../2/actual.js | 1 + .../2/expected.json | 160 ++++++++++++++ .../20/actual.js | 1 + .../20/expected.json | 200 ++++++++++++++++++ .../21/actual.js | 1 + .../21/expected.json | 119 +++++++++++ .../22/actual.js | 1 + .../22/expected.json | 160 ++++++++++++++ .../23/actual.js | 1 + .../23/expected.json | 160 ++++++++++++++ .../24/actual.js | 1 + .../24/expected.json | 200 ++++++++++++++++++ .../25/actual.js | 1 + .../25/expected.json | 119 +++++++++++ .../26/actual.js | 1 + .../26/expected.json | 160 ++++++++++++++ .../27/actual.js | 1 + .../27/expected.json | 160 ++++++++++++++ .../28/actual.js | 1 + .../28/expected.json | 200 ++++++++++++++++++ .../29/actual.js | 1 + .../29/expected.json | 119 +++++++++++ .../3/actual.js | 1 + .../3/expected.json | 160 ++++++++++++++ .../30/actual.js | 1 + .../30/expected.json | 160 ++++++++++++++ .../31/actual.js | 1 + .../31/expected.json | 160 ++++++++++++++ .../32/actual.js | 1 + .../32/expected.json | 200 ++++++++++++++++++ .../33/actual.js | 1 + .../33/expected.json | 119 +++++++++++ .../34/actual.js | 1 + .../34/expected.json | 160 ++++++++++++++ .../35/actual.js | 1 + .../35/expected.json | 160 ++++++++++++++ .../36/actual.js | 1 + .../36/expected.json | 200 ++++++++++++++++++ .../37/actual.js | 1 + .../37/expected.json | 119 +++++++++++ .../38/actual.js | 1 + .../38/expected.json | 160 ++++++++++++++ .../39/actual.js | 1 + .../39/expected.json | 160 ++++++++++++++ .../4/actual.js | 1 + .../4/expected.json | 200 ++++++++++++++++++ .../40/actual.js | 1 + .../40/expected.json | 200 ++++++++++++++++++ .../41/actual.js | 1 + .../41/expected.json | 119 +++++++++++ .../42/actual.js | 1 + .../42/expected.json | 160 ++++++++++++++ .../43/actual.js | 1 + .../43/expected.json | 160 ++++++++++++++ .../44/actual.js | 1 + .../44/expected.json | 200 ++++++++++++++++++ .../45/actual.js | 1 + .../45/expected.json | 119 +++++++++++ .../46/actual.js | 1 + .../46/expected.json | 160 ++++++++++++++ .../47/actual.js | 1 + .../47/expected.json | 160 ++++++++++++++ .../48/actual.js | 1 + .../48/expected.json | 200 ++++++++++++++++++ .../49/actual.js | 1 + .../49/expected.json | 119 +++++++++++ .../5/actual.js | 1 + .../5/expected.json | 119 +++++++++++ .../50/actual.js | 1 + .../50/expected.json | 160 ++++++++++++++ .../51/actual.js | 1 + .../51/expected.json | 160 ++++++++++++++ .../52/actual.js | 1 + .../52/expected.json | 200 ++++++++++++++++++ .../53/actual.js | 1 + .../53/expected.json | 119 +++++++++++ .../54/actual.js | 1 + .../54/expected.json | 160 ++++++++++++++ .../55/actual.js | 1 + .../55/expected.json | 160 ++++++++++++++ .../56/actual.js | 1 + .../56/expected.json | 200 ++++++++++++++++++ .../57/actual.js | 1 + .../57/expected.json | 119 +++++++++++ .../58/actual.js | 1 + .../58/expected.json | 160 ++++++++++++++ .../59/actual.js | 1 + .../59/expected.json | 160 ++++++++++++++ .../6/actual.js | 1 + .../6/expected.json | 160 ++++++++++++++ .../60/actual.js | 1 + .../60/expected.json | 200 ++++++++++++++++++ .../61/actual.js | 1 + .../61/expected.json | 119 +++++++++++ .../62/actual.js | 1 + .../62/expected.json | 160 ++++++++++++++ .../63/actual.js | 1 + .../63/expected.json | 160 ++++++++++++++ .../64/actual.js | 1 + .../64/expected.json | 200 ++++++++++++++++++ .../65/actual.js | 1 + .../65/expected.json | 119 +++++++++++ .../66/actual.js | 1 + .../66/expected.json | 160 ++++++++++++++ .../67/actual.js | 1 + .../67/expected.json | 160 ++++++++++++++ .../68/actual.js | 1 + .../68/expected.json | 200 ++++++++++++++++++ .../7/actual.js | 1 + .../7/expected.json | 160 ++++++++++++++ .../8/actual.js | 1 + .../8/expected.json | 200 ++++++++++++++++++ .../9/actual.js | 1 + .../9/expected.json | 119 +++++++++++ .../options.json | 3 + .../1/actual.js | 1 + .../1/options.json | 6 + .../10/actual.js | 1 + .../10/options.json | 6 + .../11/actual.js | 1 + .../11/options.json | 6 + .../12/actual.js | 1 + .../12/options.json | 6 + .../13/actual.js | 1 + .../13/options.json | 6 + .../14/actual.js | 1 + .../14/options.json | 6 + .../15/actual.js | 1 + .../15/options.json | 6 + .../16/actual.js | 1 + .../16/options.json | 6 + .../17/actual.js | 1 + .../17/options.json | 6 + .../18/actual.js | 1 + .../18/options.json | 6 + .../19/actual.js | 1 + .../19/options.json | 6 + .../2/actual.js | 1 + .../2/options.json | 6 + .../20/actual.js | 1 + .../20/options.json | 6 + .../21/actual.js | 1 + .../21/options.json | 6 + .../22/actual.js | 1 + .../22/options.json | 6 + .../23/actual.js | 1 + .../23/options.json | 6 + .../24/actual.js | 1 + .../24/options.json | 6 + .../25/actual.js | 1 + .../25/options.json | 6 + .../26/actual.js | 1 + .../26/options.json | 6 + .../27/actual.js | 1 + .../27/options.json | 6 + .../28/actual.js | 1 + .../28/options.json | 6 + .../29/actual.js | 1 + .../29/options.json | 6 + .../3/actual.js | 1 + .../3/options.json | 6 + .../30/actual.js | 1 + .../30/options.json | 6 + .../31/actual.js | 1 + .../31/options.json | 6 + .../32/actual.js | 1 + .../32/options.json | 6 + .../33/actual.js | 1 + .../33/options.json | 6 + .../34/actual.js | 1 + .../34/options.json | 6 + .../35/actual.js | 1 + .../35/options.json | 6 + .../36/actual.js | 1 + .../36/options.json | 6 + .../37/actual.js | 1 + .../37/options.json | 6 + .../38/actual.js | 1 + .../38/options.json | 6 + .../39/actual.js | 1 + .../39/options.json | 6 + .../4/actual.js | 1 + .../4/options.json | 6 + .../40/actual.js | 1 + .../40/options.json | 6 + .../41/actual.js | 1 + .../41/options.json | 6 + .../42/actual.js | 1 + .../42/options.json | 6 + .../43/actual.js | 1 + .../43/options.json | 6 + .../44/actual.js | 1 + .../44/options.json | 6 + .../45/actual.js | 1 + .../45/options.json | 6 + .../46/actual.js | 1 + .../46/options.json | 6 + .../47/actual.js | 1 + .../47/options.json | 6 + .../48/actual.js | 1 + .../48/options.json | 6 + .../49/actual.js | 1 + .../49/options.json | 6 + .../5/actual.js | 1 + .../5/options.json | 6 + .../50/actual.js | 1 + .../50/options.json | 6 + .../51/actual.js | 1 + .../51/options.json | 6 + .../52/actual.js | 1 + .../52/options.json | 6 + .../53/actual.js | 1 + .../53/options.json | 6 + .../54/actual.js | 1 + .../54/options.json | 6 + .../55/actual.js | 1 + .../55/options.json | 6 + .../56/actual.js | 1 + .../56/options.json | 6 + .../57/actual.js | 1 + .../57/options.json | 6 + .../58/actual.js | 1 + .../58/options.json | 6 + .../59/actual.js | 1 + .../59/options.json | 6 + .../6/actual.js | 1 + .../6/options.json | 6 + .../60/actual.js | 1 + .../60/options.json | 6 + .../61/actual.js | 1 + .../61/options.json | 6 + .../62/actual.js | 1 + .../62/options.json | 6 + .../63/actual.js | 1 + .../63/options.json | 6 + .../64/actual.js | 1 + .../64/options.json | 6 + .../65/actual.js | 1 + .../65/options.json | 6 + .../66/actual.js | 1 + .../66/options.json | 6 + .../67/actual.js | 1 + .../67/options.json | 6 + .../68/actual.js | 1 + .../68/options.json | 6 + .../7/actual.js | 1 + .../7/options.json | 6 + .../8/actual.js | 1 + .../8/options.json | 6 + .../9/actual.js | 1 + .../9/options.json | 6 + 290 files changed, 11491 insertions(+), 38 deletions(-) create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json diff --git a/README.md b/README.md index 6836b8f84e..ad2a8fd874 100644 --- a/README.md +++ b/README.md @@ -131,3 +131,4 @@ require("babylon").parse("code", { - `functionBind` - `functionSent` - `dynamicImport` + - `templateInvalidEscapes` diff --git a/ast/spec.md b/ast/spec.md index e3c5ec07b0..f06b1ebe99 100644 --- a/ast/spec.md +++ b/ast/spec.md @@ -959,7 +959,7 @@ interface TemplateElement <: Node { type: "TemplateElement"; tail: boolean; value: { - cooked: string; + cooked: string | null; raw: string; }; } diff --git a/src/parser/expression.js b/src/parser/expression.js index 6c6777f380..775d658f32 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -317,7 +317,7 @@ pp.parseSubscripts = function (base, startPos, startLoc, noCalls) { } else if (this.match(tt.backQuote)) { const node = this.startNodeAt(startPos, startLoc); node.tag = base; - node.quasi = this.parseTemplate(); + node.quasi = this.parseTemplate(true); base = this.finishNode(node, "TaggedTemplateExpression"); } else { return base; @@ -506,7 +506,7 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { return this.parseNew(); case tt.backQuote: - return this.parseTemplate(); + return this.parseTemplate(false); case tt.doubleColon: node = this.startNode(); @@ -685,8 +685,15 @@ pp.parseNew = function () { // Parse template expression. -pp.parseTemplateElement = function () { +pp.parseTemplateElement = function (isTagged) { const elem = this.startNode(); + if (this.state.value === null) { + if (!isTagged || !this.hasPlugin("templateInvalidEscapes")) { + this.raise(this.state.invalidTemplateEscapePosition, "Invalid escape sequence in template"); + } else { + this.state.invalidTemplateEscapePosition = null; + } + } elem.value = { raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), cooked: this.state.value @@ -696,17 +703,17 @@ pp.parseTemplateElement = function () { return this.finishNode(elem, "TemplateElement"); }; -pp.parseTemplate = function () { +pp.parseTemplate = function (isTagged) { const node = this.startNode(); this.next(); node.expressions = []; - let curElt = this.parseTemplateElement(); + let curElt = this.parseTemplateElement(isTagged); node.quasis = [curElt]; while (!curElt.tail) { this.expect(tt.dollarBraceL); node.expressions.push(this.parseExpression()); this.expect(tt.braceR); - node.quasis.push(curElt = this.parseTemplateElement()); + node.quasis.push(curElt = this.parseTemplateElement(isTagged)); } this.next(); return this.finishNode(node, "TemplateLiteral"); diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index 4c35054c2b..a058ba91a5 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -599,17 +599,26 @@ export default class Tokenizer { // Read a string value, interpreting backslash-escapes. - readCodePoint() { + readCodePoint(throwOnInvalid) { const ch = this.input.charCodeAt(this.state.pos); let code; - if (ch === 123) { + if (ch === 123) { // '{' const codePos = ++this.state.pos; - code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos); + code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, throwOnInvalid); ++this.state.pos; - if (code > 0x10FFFF) this.raise(codePos, "Code point out of bounds"); + if (code === null) { + --this.state.invalidTemplateEscapePosition; // to point to the '\'' instead of the 'u' + } else if (code > 0x10FFFF) { + if (throwOnInvalid) { + this.raise(codePos, "Code point out of bounds"); + } else { + this.state.invalidTemplateEscapePosition = codePos - 2; + return null; + } + } } else { - code = this.readHexChar(4); + code = this.readHexChar(4, throwOnInvalid); } return code; } @@ -636,7 +645,7 @@ export default class Tokenizer { // Reads template string tokens. readTmplToken() { - let out = "", chunkStart = this.state.pos; + let out = "", chunkStart = this.state.pos, containsInvalid = false; for (;;) { if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated template"); const ch = this.input.charCodeAt(this.state.pos); @@ -651,11 +660,16 @@ export default class Tokenizer { } } out += this.input.slice(chunkStart, this.state.pos); - return this.finishToken(tt.template, out); + return this.finishToken(tt.template, containsInvalid ? null : out); } if (ch === 92) { // '\' out += this.input.slice(chunkStart, this.state.pos); - out += this.readEscapedChar(true); + const escaped = this.readEscapedChar(true); + if (escaped === null) { + containsInvalid = true; + } else { + out += escaped; + } chunkStart = this.state.pos; } else if (isNewLine(ch)) { out += this.input.slice(chunkStart, this.state.pos); @@ -682,13 +696,20 @@ export default class Tokenizer { // Used to read escaped characters readEscapedChar(inTemplate) { + const throwOnInvalid = !inTemplate; const ch = this.input.charCodeAt(++this.state.pos); ++this.state.pos; switch (ch) { case 110: return "\n"; // 'n' -> '\n' case 114: return "\r"; // 'r' -> '\r' - case 120: return String.fromCharCode(this.readHexChar(2)); // 'x' - case 117: return codePointToString(this.readCodePoint()); // 'u' + case 120: { // 'x' + const code = this.readHexChar(2, throwOnInvalid); + return code === null ? null : String.fromCharCode(code); + } + case 117: { // 'u' + const code = this.readCodePoint(throwOnInvalid); + return code === null ? null : codePointToString(code); + } case 116: return "\t"; // 't' -> '\t' case 98: return "\b"; // 'b' -> '\b' case 118: return "\u000b"; // 'v' -> '\u000b' @@ -700,6 +721,7 @@ export default class Tokenizer { return ""; default: if (ch >= 48 && ch <= 55) { + const codePos = this.state.pos - 1; let octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0]; let octal = parseInt(octalStr, 8); if (octal > 255) { @@ -707,12 +729,16 @@ export default class Tokenizer { octal = parseInt(octalStr, 8); } if (octal > 0) { - if (!this.state.containsOctal) { + if (inTemplate) { + this.state.invalidTemplateEscapePosition = codePos; + return null; + } else if (this.state.strict) { + this.raise(codePos, "Octal literal in strict mode"); + } else if (!this.state.containsOctal) { + // These properties are only used to throw an error for an octal which occurs + // in a directive which occurs prior to a "use strict" directive. this.state.containsOctal = true; - this.state.octalPosition = this.state.pos - 2; - } - if (this.state.strict || inTemplate) { - this.raise(this.state.pos - 2, "Octal literal in strict mode"); + this.state.octalPosition = codePos; } } this.state.pos += octalStr.length - 1; @@ -722,12 +748,19 @@ export default class Tokenizer { } } - // Used to read character escape sequences ('\x', '\u', '\U'). + // Used to read character escape sequences ('\x', '\u'). - readHexChar(len) { + readHexChar(len, throwOnInvalid) { const codePos = this.state.pos; const n = this.readInt(16, len); - if (n === null) this.raise(codePos, "Bad character escape sequence"); + if (n === null) { + if (throwOnInvalid) { + this.raise(codePos, "Bad character escape sequence"); + } else { + this.state.pos = codePos - 1; + this.state.invalidTemplateEscapePosition = codePos - 1; + } + } return n; } @@ -755,7 +788,7 @@ export default class Tokenizer { } ++this.state.pos; - const esc = this.readCodePoint(); + const esc = this.readCodePoint(true); if (!(first ? isIdentifierStart : isIdentifierChar)(esc, true)) { this.raise(escStart, "Invalid Unicode escape"); } diff --git a/src/tokenizer/state.js b/src/tokenizer/state.js index 371bcdfd7d..2e35b3ac4f 100644 --- a/src/tokenizer/state.js +++ b/src/tokenizer/state.js @@ -50,6 +50,8 @@ export default class State { this.containsEsc = this.containsOctal = false; this.octalPosition = null; + this.invalidTemplateEscapePosition = null; + this.exportedIdentifiers = []; return this; diff --git a/test/fixtures/core/uncategorised/499/options.json b/test/fixtures/core/uncategorised/499/options.json index 68bfd75832..11a57d6c56 100644 --- a/test/fixtures/core/uncategorised/499/options.json +++ b/test/fixtures/core/uncategorised/499/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:34)" + "throws": "Octal literal in strict mode (1:35)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/501/options.json b/test/fixtures/core/uncategorised/501/options.json index fa3a33b55e..2984958689 100644 --- a/test/fixtures/core/uncategorised/501/options.json +++ b/test/fixtures/core/uncategorised/501/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:37)" + "throws": "Octal literal in strict mode (1:38)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/503/options.json b/test/fixtures/core/uncategorised/503/options.json index e689079a79..e92ad336dd 100644 --- a/test/fixtures/core/uncategorised/503/options.json +++ b/test/fixtures/core/uncategorised/503/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:68)" + "throws": "Octal literal in strict mode (1:69)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/290/options.json b/test/fixtures/es2015/uncategorised/290/options.json index 890fce8204..8513ff0bed 100644 --- a/test/fixtures/es2015/uncategorised/290/options.json +++ b/test/fixtures/es2015/uncategorised/290/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:22)" + "throws": "Invalid escape sequence in template (1:23)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/339/options.json b/test/fixtures/es2015/uncategorised/339/options.json index 857b44ba21..3ae5cb6c96 100644 --- a/test/fixtures/es2015/uncategorised/339/options.json +++ b/test/fixtures/es2015/uncategorised/339/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:1)" + "throws": "Invalid escape sequence in template (1:2)" } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json b/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json index 857b44ba21..3ae5cb6c96 100644 --- a/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json +++ b/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:1)" + "throws": "Invalid escape sequence in template (1:2)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json index 91bbdfe83f..61a5834b63 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:1)" + "throws": "Octal literal in strict mode (1:2)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json index 68bfd75832..11a57d6c56 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:34)" + "throws": "Octal literal in strict mode (1:35)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json index fa3a33b55e..2984958689 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:37)" + "throws": "Octal literal in strict mode (1:38)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json index ae2bfab55c..d094fe0284 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:35)" + "throws": "Octal literal in strict mode (1:36)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json index ae2bfab55c..d094fe0284 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:35)" + "throws": "Octal literal in strict mode (1:36)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json index e689079a79..e92ad336dd 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:68)" + "throws": "Octal literal in strict mode (1:69)" } \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/actual.js new file mode 100644 index 0000000000..e62c7abcaf --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/actual.js @@ -0,0 +1 @@ +sampleTag`\01` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/expected.json new file mode 100644 index 0000000000..d8b75cc1d0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/actual.js new file mode 100644 index 0000000000..1b7671b74a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/actual.js @@ -0,0 +1 @@ +sampleTag`\xg${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/expected.json new file mode 100644 index 0000000000..6ef94ad9bd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/actual.js new file mode 100644 index 0000000000..87bfd46be5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\xg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/expected.json new file mode 100644 index 0000000000..1cf6041972 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/actual.js new file mode 100644 index 0000000000..eed8a8c9a1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\xg${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/expected.json new file mode 100644 index 0000000000..eaa8c4ab42 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/actual.js new file mode 100644 index 0000000000..28ab31c9c1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/actual.js @@ -0,0 +1 @@ +sampleTag`\xAg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json new file mode 100644 index 0000000000..6422cab83c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js new file mode 100644 index 0000000000..cc0ec32af0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js @@ -0,0 +1 @@ +sampleTag`\xAg${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/expected.json new file mode 100644 index 0000000000..253459c464 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/actual.js new file mode 100644 index 0000000000..cd57463528 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\xAg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/expected.json new file mode 100644 index 0000000000..ec73dac5d8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/actual.js new file mode 100644 index 0000000000..04cdb9e9b2 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\xAg${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/expected.json new file mode 100644 index 0000000000..bf367875f1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/actual.js new file mode 100644 index 0000000000..191ca653c0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/actual.js @@ -0,0 +1 @@ +sampleTag`\u0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/expected.json new file mode 100644 index 0000000000..db6bfd7588 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/actual.js new file mode 100644 index 0000000000..ab93eda9d9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/actual.js @@ -0,0 +1 @@ +sampleTag`\u0${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/expected.json new file mode 100644 index 0000000000..7d1d4ecac2 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/actual.js new file mode 100644 index 0000000000..d26dfc60e7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/expected.json new file mode 100644 index 0000000000..30b397ba11 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/actual.js new file mode 100644 index 0000000000..4fb52640f5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/actual.js @@ -0,0 +1 @@ +sampleTag`\01${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/expected.json new file mode 100644 index 0000000000..dc2581302c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/actual.js new file mode 100644 index 0000000000..7b0f56fa2a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u0${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/expected.json new file mode 100644 index 0000000000..5995e5c491 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/actual.js new file mode 100644 index 0000000000..6aa1d27769 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/actual.js @@ -0,0 +1 @@ +sampleTag`\u0g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/expected.json new file mode 100644 index 0000000000..3eff694145 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/actual.js new file mode 100644 index 0000000000..44eb637a41 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/actual.js @@ -0,0 +1 @@ +sampleTag`\u0g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/expected.json new file mode 100644 index 0000000000..fcfe7dbcd0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/actual.js new file mode 100644 index 0000000000..30d440cd97 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u0g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/expected.json new file mode 100644 index 0000000000..aa1740dac3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/actual.js new file mode 100644 index 0000000000..59d991056a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u0g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/expected.json new file mode 100644 index 0000000000..39b3bb484e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/actual.js new file mode 100644 index 0000000000..05d2fafe66 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/actual.js @@ -0,0 +1 @@ +sampleTag`\u00g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/expected.json new file mode 100644 index 0000000000..f978e9e2bb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/actual.js new file mode 100644 index 0000000000..525cfc3d26 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/actual.js @@ -0,0 +1 @@ +sampleTag`\u00g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/expected.json new file mode 100644 index 0000000000..02603f46cd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/actual.js new file mode 100644 index 0000000000..b5687e98f8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u00g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/expected.json new file mode 100644 index 0000000000..bda12c9651 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/actual.js new file mode 100644 index 0000000000..39b7ca87b5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u00g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/expected.json new file mode 100644 index 0000000000..2ee6bf6d75 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/expected.json @@ -0,0 +1,200 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/actual.js new file mode 100644 index 0000000000..a409ba9123 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/actual.js @@ -0,0 +1 @@ +sampleTag`\u000g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/expected.json new file mode 100644 index 0000000000..ab787c76b0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/actual.js new file mode 100644 index 0000000000..592b5c6eb8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\01` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/expected.json new file mode 100644 index 0000000000..82a87607c9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/actual.js new file mode 100644 index 0000000000..c1b737a8de --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/actual.js @@ -0,0 +1 @@ +sampleTag`\u000g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/expected.json new file mode 100644 index 0000000000..5467e09a34 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/actual.js new file mode 100644 index 0000000000..1936125122 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u000g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/expected.json new file mode 100644 index 0000000000..7792df9415 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/actual.js new file mode 100644 index 0000000000..8920322734 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u000g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/expected.json new file mode 100644 index 0000000000..00a0ad78bc --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/actual.js new file mode 100644 index 0000000000..ff7451e4f7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/actual.js @@ -0,0 +1 @@ +sampleTag`\u{}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/expected.json new file mode 100644 index 0000000000..11d9cd92b3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/actual.js new file mode 100644 index 0000000000..b936b2aa79 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/actual.js @@ -0,0 +1 @@ +sampleTag`\u{}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/expected.json new file mode 100644 index 0000000000..072eac4db4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/actual.js new file mode 100644 index 0000000000..af58ad5476 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/expected.json new file mode 100644 index 0000000000..f6e57d84f1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/actual.js new file mode 100644 index 0000000000..9809674f2d --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/expected.json new file mode 100644 index 0000000000..5a52cbb588 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/actual.js new file mode 100644 index 0000000000..f3b7c60be7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/actual.js @@ -0,0 +1 @@ +sampleTag`\u{-0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/expected.json new file mode 100644 index 0000000000..b6ad827a92 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/actual.js new file mode 100644 index 0000000000..2de362b243 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/actual.js @@ -0,0 +1 @@ +sampleTag`\u{-0}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/expected.json new file mode 100644 index 0000000000..b25f264baf --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/actual.js new file mode 100644 index 0000000000..aec71687c2 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{-0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/expected.json new file mode 100644 index 0000000000..d0ee5e2b4f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/actual.js new file mode 100644 index 0000000000..4e72a53bb6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\01${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/expected.json new file mode 100644 index 0000000000..3c240cbca5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/actual.js new file mode 100644 index 0000000000..4884482024 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{-0}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/expected.json new file mode 100644 index 0000000000..c5c6235df6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/actual.js new file mode 100644 index 0000000000..0dbd371767 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/actual.js @@ -0,0 +1 @@ +sampleTag`\u{g}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/expected.json new file mode 100644 index 0000000000..70facd5b6a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/actual.js new file mode 100644 index 0000000000..506ec11d83 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/actual.js @@ -0,0 +1 @@ +sampleTag`\u{g}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/expected.json new file mode 100644 index 0000000000..4dd20c77bc --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/actual.js new file mode 100644 index 0000000000..2f863994a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{g}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/expected.json new file mode 100644 index 0000000000..d75d926a77 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/actual.js new file mode 100644 index 0000000000..96f9d738d9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{g}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/expected.json new file mode 100644 index 0000000000..811cbc9664 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/expected.json @@ -0,0 +1,200 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/actual.js new file mode 100644 index 0000000000..7be4c3fa0f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/actual.js @@ -0,0 +1 @@ +sampleTag`\u{` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/expected.json new file mode 100644 index 0000000000..7e104de733 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/actual.js new file mode 100644 index 0000000000..000f2fbf37 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/actual.js @@ -0,0 +1 @@ +sampleTag`\u{${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/expected.json new file mode 100644 index 0000000000..3f850af6f9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/actual.js new file mode 100644 index 0000000000..74d5b29f61 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/expected.json new file mode 100644 index 0000000000..4d25257bf2 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/actual.js new file mode 100644 index 0000000000..849edc693e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/expected.json new file mode 100644 index 0000000000..54b4914e13 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/actual.js new file mode 100644 index 0000000000..9575b3d816 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\\` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/expected.json new file mode 100644 index 0000000000..5dc69624b3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/actual.js new file mode 100644 index 0000000000..00c3211a93 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/actual.js @@ -0,0 +1 @@ +sampleTag`\1` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json new file mode 100644 index 0000000000..bf13103e1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js new file mode 100644 index 0000000000..a931f49dc3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\\${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/expected.json new file mode 100644 index 0000000000..88982b42de --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/actual.js new file mode 100644 index 0000000000..6c51808602 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\\` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/expected.json new file mode 100644 index 0000000000..999202808b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/actual.js new file mode 100644 index 0000000000..71c32286f8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\\${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/expected.json new file mode 100644 index 0000000000..ff94ba4145 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/expected.json @@ -0,0 +1,200 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/actual.js new file mode 100644 index 0000000000..dadcb43b49 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\`` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/expected.json new file mode 100644 index 0000000000..bd743338a8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/actual.js new file mode 100644 index 0000000000..9d9f26b33b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\`${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/expected.json new file mode 100644 index 0000000000..1ef2fcc477 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/actual.js new file mode 100644 index 0000000000..e108605dd8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\`` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/expected.json new file mode 100644 index 0000000000..db9472adc3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/actual.js new file mode 100644 index 0000000000..c53213af0b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\`${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/expected.json new file mode 100644 index 0000000000..a29dca62cb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/expected.json @@ -0,0 +1,200 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/actual.js new file mode 100644 index 0000000000..35fb813aeb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/actual.js @@ -0,0 +1 @@ +sampleTag`\u{0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/expected.json new file mode 100644 index 0000000000..440e1e7b6c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/actual.js new file mode 100644 index 0000000000..e6a45880f4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/actual.js @@ -0,0 +1 @@ +sampleTag`\u{0${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/expected.json new file mode 100644 index 0000000000..d5c6e26513 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/actual.js new file mode 100644 index 0000000000..8c3d8e2394 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/expected.json new file mode 100644 index 0000000000..ea9c9bb696 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/actual.js new file mode 100644 index 0000000000..636accd45c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/actual.js @@ -0,0 +1 @@ +sampleTag`\1${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/expected.json new file mode 100644 index 0000000000..e756aa3c50 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/actual.js new file mode 100644 index 0000000000..3c91289aa4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{0${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/expected.json new file mode 100644 index 0000000000..d77b26a5d6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/actual.js new file mode 100644 index 0000000000..a04b3de90f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\u{0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json new file mode 100644 index 0000000000..4d954dc2d3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json @@ -0,0 +1,119 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js new file mode 100644 index 0000000000..a01abfbccb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\u{0}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/expected.json new file mode 100644 index 0000000000..a4ab688484 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/actual.js new file mode 100644 index 0000000000..7180334fe7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\u{0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/expected.json new file mode 100644 index 0000000000..d6f59b6cd6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/actual.js new file mode 100644 index 0000000000..913257ec23 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\u{0}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/expected.json new file mode 100644 index 0000000000..b3cd32eb66 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/actual.js new file mode 100644 index 0000000000..57cee514aa --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/actual.js @@ -0,0 +1 @@ +sampleTag`\u{110000}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/expected.json new file mode 100644 index 0000000000..d381bed78f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/expected.json @@ -0,0 +1,119 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/actual.js new file mode 100644 index 0000000000..1021623c19 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/actual.js @@ -0,0 +1 @@ +sampleTag`\u{110000}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/expected.json new file mode 100644 index 0000000000..b6d1bad8e0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/actual.js new file mode 100644 index 0000000000..28d404e2e8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{110000}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/expected.json new file mode 100644 index 0000000000..9f89295266 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/actual.js new file mode 100644 index 0000000000..ddfde0880a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{110000}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/expected.json new file mode 100644 index 0000000000..59ad74af19 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/actual.js new file mode 100644 index 0000000000..7ae506f9be --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\1` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/expected.json new file mode 100644 index 0000000000..8dd1cb7248 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/actual.js new file mode 100644 index 0000000000..808e93f360 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\1${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/expected.json new file mode 100644 index 0000000000..8fd7e0ab30 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/expected.json @@ -0,0 +1,200 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/actual.js new file mode 100644 index 0000000000..6a82dddf36 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/actual.js @@ -0,0 +1 @@ +sampleTag`\xg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/expected.json new file mode 100644 index 0000000000..2306ad4846 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json new file mode 100644 index 0000000000..eb93fe5b94 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["templateInvalidEscapes"] +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/actual.js new file mode 100644 index 0000000000..38c654a5b4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/actual.js @@ -0,0 +1 @@ +`\01` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/actual.js new file mode 100644 index 0000000000..f9b52ebde0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/actual.js @@ -0,0 +1 @@ +`\xg${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/actual.js new file mode 100644 index 0000000000..a0c30ccebf --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/actual.js @@ -0,0 +1 @@ +`left${0}\xg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/actual.js new file mode 100644 index 0000000000..b951c4896c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/actual.js @@ -0,0 +1 @@ +`left${0}\xg${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/actual.js new file mode 100644 index 0000000000..59702c7be1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/actual.js @@ -0,0 +1 @@ +`\xAg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/actual.js new file mode 100644 index 0000000000..2b1e66e6c5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/actual.js @@ -0,0 +1 @@ +`\xAg${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/actual.js new file mode 100644 index 0000000000..1742efdd1d --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/actual.js @@ -0,0 +1 @@ +`left${0}\xAg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/actual.js new file mode 100644 index 0000000000..0b999a4306 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/actual.js @@ -0,0 +1 @@ +`left${0}\xAg${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/actual.js new file mode 100644 index 0000000000..5750e28788 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/actual.js @@ -0,0 +1 @@ +`\u0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/actual.js new file mode 100644 index 0000000000..8f0e13d9f8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/actual.js @@ -0,0 +1 @@ +`\u0${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/actual.js new file mode 100644 index 0000000000..84fc9009b6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/actual.js @@ -0,0 +1 @@ +`left${0}\u0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/actual.js new file mode 100644 index 0000000000..629c7645c9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/actual.js @@ -0,0 +1 @@ +`\01${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/actual.js new file mode 100644 index 0000000000..66024330d3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/actual.js @@ -0,0 +1 @@ +`left${0}\u0${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/actual.js new file mode 100644 index 0000000000..55cd59a2c7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/actual.js @@ -0,0 +1 @@ +`\u0g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/actual.js new file mode 100644 index 0000000000..0968b3b2b0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/actual.js @@ -0,0 +1 @@ +`\u0g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/actual.js new file mode 100644 index 0000000000..39b67a92dd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/actual.js @@ -0,0 +1 @@ +`left${0}\u0g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/actual.js new file mode 100644 index 0000000000..d3656d3d08 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/actual.js @@ -0,0 +1 @@ +`left${0}\u0g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/actual.js new file mode 100644 index 0000000000..f401af6e63 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/actual.js @@ -0,0 +1 @@ +`\u00g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/actual.js new file mode 100644 index 0000000000..bbd2bb505b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/actual.js @@ -0,0 +1 @@ +`\u00g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/actual.js new file mode 100644 index 0000000000..710a43999a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/actual.js @@ -0,0 +1 @@ +`left${0}\u00g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/actual.js new file mode 100644 index 0000000000..f4a5e3653a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/actual.js @@ -0,0 +1 @@ +`left${0}\u00g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/actual.js new file mode 100644 index 0000000000..4c4daa380e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/actual.js @@ -0,0 +1 @@ +`\u000g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/actual.js new file mode 100644 index 0000000000..3663eaffcc --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/actual.js @@ -0,0 +1 @@ +`left${0}\01` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/actual.js new file mode 100644 index 0000000000..d0525f75cb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/actual.js @@ -0,0 +1 @@ +`\u000g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/actual.js new file mode 100644 index 0000000000..981b65ab1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/actual.js @@ -0,0 +1 @@ +`left${0}\u000g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/actual.js new file mode 100644 index 0000000000..c6441febbd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/actual.js @@ -0,0 +1 @@ +`left${0}\u000g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/actual.js new file mode 100644 index 0000000000..90ace87a84 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/actual.js @@ -0,0 +1 @@ +`\u{}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/actual.js new file mode 100644 index 0000000000..eadeb7b3cd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/actual.js @@ -0,0 +1 @@ +`\u{}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/actual.js new file mode 100644 index 0000000000..cd7b76fe4f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/actual.js @@ -0,0 +1 @@ +`left${0}\u{}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/actual.js new file mode 100644 index 0000000000..79a1eedc9a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/actual.js @@ -0,0 +1 @@ +`left${0}\u{}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/actual.js new file mode 100644 index 0000000000..d7c716f1b5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/actual.js @@ -0,0 +1 @@ +`\u{-0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/actual.js new file mode 100644 index 0000000000..da568ab1dd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/actual.js @@ -0,0 +1 @@ +`\u{-0}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/actual.js new file mode 100644 index 0000000000..a564107d91 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/actual.js @@ -0,0 +1 @@ +`left${0}\u{-0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/actual.js new file mode 100644 index 0000000000..f0ea873a5d --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/actual.js @@ -0,0 +1 @@ +`left${0}\01${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/actual.js new file mode 100644 index 0000000000..66ecba8b94 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/actual.js @@ -0,0 +1 @@ +`left${0}\u{-0}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/actual.js new file mode 100644 index 0000000000..a4b058d036 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/actual.js @@ -0,0 +1 @@ +`\u{g}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/actual.js new file mode 100644 index 0000000000..05dd670eb9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/actual.js @@ -0,0 +1 @@ +`\u{g}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/actual.js new file mode 100644 index 0000000000..0c02fbcc5b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/actual.js @@ -0,0 +1 @@ +`left${0}\u{g}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/actual.js new file mode 100644 index 0000000000..f81c6beccc --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/actual.js @@ -0,0 +1 @@ +`left${0}\u{g}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/actual.js new file mode 100644 index 0000000000..2e6b74b44e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/actual.js @@ -0,0 +1 @@ +`\u{` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/actual.js new file mode 100644 index 0000000000..162c16696d --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/actual.js @@ -0,0 +1 @@ +`\u{${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/actual.js new file mode 100644 index 0000000000..72bc784142 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/actual.js @@ -0,0 +1 @@ +`left${0}\u{` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/actual.js new file mode 100644 index 0000000000..af0cefff92 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/actual.js @@ -0,0 +1 @@ +`left${0}\u{${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/actual.js new file mode 100644 index 0000000000..512229f60c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/actual.js @@ -0,0 +1 @@ +`\u{\\` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/actual.js new file mode 100644 index 0000000000..a4ffac63b8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/actual.js @@ -0,0 +1 @@ +`\1` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/actual.js new file mode 100644 index 0000000000..2811cdfcf9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/actual.js @@ -0,0 +1 @@ +`\u{\\${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/actual.js new file mode 100644 index 0000000000..1f3f5e3640 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/actual.js @@ -0,0 +1 @@ +`left${0}\u{\\` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/actual.js new file mode 100644 index 0000000000..fd255a9f91 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/actual.js @@ -0,0 +1 @@ +`left${0}\u{\\${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/actual.js new file mode 100644 index 0000000000..77e7e029e4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/actual.js @@ -0,0 +1 @@ +`\u{\`` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/actual.js new file mode 100644 index 0000000000..843e2f4031 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/actual.js @@ -0,0 +1 @@ +`\u{\`${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/actual.js new file mode 100644 index 0000000000..08c9e10363 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/actual.js @@ -0,0 +1 @@ +`left${0}\u{\`` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/actual.js new file mode 100644 index 0000000000..d6b1f25a7e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/actual.js @@ -0,0 +1 @@ +`left${0}\u{\`${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/actual.js new file mode 100644 index 0000000000..af2be992b1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/actual.js @@ -0,0 +1 @@ +`\u{0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/actual.js new file mode 100644 index 0000000000..6612fdbb02 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/actual.js @@ -0,0 +1 @@ +`\u{0${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/actual.js new file mode 100644 index 0000000000..983aae670e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/actual.js @@ -0,0 +1 @@ +`left${0}\u{0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/actual.js new file mode 100644 index 0000000000..554c901c69 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/actual.js @@ -0,0 +1 @@ +`\1${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/actual.js new file mode 100644 index 0000000000..611f774bdc --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/actual.js @@ -0,0 +1 @@ +`left${0}\u{0${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/actual.js new file mode 100644 index 0000000000..6b91a4e8c7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/actual.js @@ -0,0 +1 @@ +`\u{\u{0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/actual.js new file mode 100644 index 0000000000..18df761fc1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/actual.js @@ -0,0 +1 @@ +`\u{\u{0}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/actual.js new file mode 100644 index 0000000000..5d54005046 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/actual.js @@ -0,0 +1 @@ +`left${0}\u{\u{0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/actual.js new file mode 100644 index 0000000000..e5989149e9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/actual.js @@ -0,0 +1 @@ +`left${0}\u{\u{0}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/actual.js new file mode 100644 index 0000000000..63b6915978 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/actual.js @@ -0,0 +1 @@ +`\u{110000}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/actual.js new file mode 100644 index 0000000000..4fa89bb1d3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/actual.js @@ -0,0 +1 @@ +`\u{110000}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/actual.js new file mode 100644 index 0000000000..9d9819b1eb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/actual.js @@ -0,0 +1 @@ +`left${0}\u{110000}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/actual.js new file mode 100644 index 0000000000..0ff67f82a6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/actual.js @@ -0,0 +1 @@ +`left${0}\u{110000}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/actual.js new file mode 100644 index 0000000000..03b6467b6f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/actual.js @@ -0,0 +1 @@ +`left${0}\1` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/actual.js new file mode 100644 index 0000000000..384fad327e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/actual.js @@ -0,0 +1 @@ +`left${0}\1${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/actual.js new file mode 100644 index 0000000000..a8dec8c005 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/actual.js @@ -0,0 +1 @@ +`\xg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file From 2e467ef3bc922e9765802244405f829b16ba7f7c Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 22 Mar 2017 09:50:34 +1300 Subject: [PATCH 056/105] Add support for invalid escapes in tagged templates (#274) Per the stage-3 TC39 proposal: https://github.com/tc39/proposal-template-literal-revision --- README.md | 1 + ast/spec.md | 2 +- src/parser/expression.js | 19 +- src/tokenizer/index.js | 71 +++++-- src/tokenizer/state.js | 2 + .../core/uncategorised/499/options.json | 2 +- .../core/uncategorised/501/options.json | 2 +- .../core/uncategorised/503/options.json | 2 +- .../es2015/uncategorised/290/options.json | 2 +- .../es2015/uncategorised/339/options.json | 2 +- .../invalid-escape/options.json | 2 +- .../invalid-syntax/migrated_0216/options.json | 2 +- .../invalid-syntax/migrated_0217/options.json | 2 +- .../invalid-syntax/migrated_0219/options.json | 2 +- .../invalid-syntax/migrated_0221/options.json | 2 +- .../invalid-syntax/migrated_0222/options.json | 2 +- .../invalid-syntax/migrated_0223/options.json | 2 +- .../1/actual.js | 1 + .../1/expected.json | 119 +++++++++++ .../10/actual.js | 1 + .../10/expected.json | 160 ++++++++++++++ .../11/actual.js | 1 + .../11/expected.json | 160 ++++++++++++++ .../12/actual.js | 1 + .../12/expected.json | 200 ++++++++++++++++++ .../13/actual.js | 1 + .../13/expected.json | 119 +++++++++++ .../14/actual.js | 1 + .../14/expected.json | 160 ++++++++++++++ .../15/actual.js | 1 + .../15/expected.json | 160 ++++++++++++++ .../16/actual.js | 1 + .../16/expected.json | 200 ++++++++++++++++++ .../17/actual.js | 1 + .../17/expected.json | 119 +++++++++++ .../18/actual.js | 1 + .../18/expected.json | 160 ++++++++++++++ .../19/actual.js | 1 + .../19/expected.json | 160 ++++++++++++++ .../2/actual.js | 1 + .../2/expected.json | 160 ++++++++++++++ .../20/actual.js | 1 + .../20/expected.json | 200 ++++++++++++++++++ .../21/actual.js | 1 + .../21/expected.json | 119 +++++++++++ .../22/actual.js | 1 + .../22/expected.json | 160 ++++++++++++++ .../23/actual.js | 1 + .../23/expected.json | 160 ++++++++++++++ .../24/actual.js | 1 + .../24/expected.json | 200 ++++++++++++++++++ .../25/actual.js | 1 + .../25/expected.json | 119 +++++++++++ .../26/actual.js | 1 + .../26/expected.json | 160 ++++++++++++++ .../27/actual.js | 1 + .../27/expected.json | 160 ++++++++++++++ .../28/actual.js | 1 + .../28/expected.json | 200 ++++++++++++++++++ .../29/actual.js | 1 + .../29/expected.json | 119 +++++++++++ .../3/actual.js | 1 + .../3/expected.json | 160 ++++++++++++++ .../30/actual.js | 1 + .../30/expected.json | 160 ++++++++++++++ .../31/actual.js | 1 + .../31/expected.json | 160 ++++++++++++++ .../32/actual.js | 1 + .../32/expected.json | 200 ++++++++++++++++++ .../33/actual.js | 1 + .../33/expected.json | 119 +++++++++++ .../34/actual.js | 1 + .../34/expected.json | 160 ++++++++++++++ .../35/actual.js | 1 + .../35/expected.json | 160 ++++++++++++++ .../36/actual.js | 1 + .../36/expected.json | 200 ++++++++++++++++++ .../37/actual.js | 1 + .../37/expected.json | 119 +++++++++++ .../38/actual.js | 1 + .../38/expected.json | 160 ++++++++++++++ .../39/actual.js | 1 + .../39/expected.json | 160 ++++++++++++++ .../4/actual.js | 1 + .../4/expected.json | 200 ++++++++++++++++++ .../40/actual.js | 1 + .../40/expected.json | 200 ++++++++++++++++++ .../41/actual.js | 1 + .../41/expected.json | 119 +++++++++++ .../42/actual.js | 1 + .../42/expected.json | 160 ++++++++++++++ .../43/actual.js | 1 + .../43/expected.json | 160 ++++++++++++++ .../44/actual.js | 1 + .../44/expected.json | 200 ++++++++++++++++++ .../45/actual.js | 1 + .../45/expected.json | 119 +++++++++++ .../46/actual.js | 1 + .../46/expected.json | 160 ++++++++++++++ .../47/actual.js | 1 + .../47/expected.json | 160 ++++++++++++++ .../48/actual.js | 1 + .../48/expected.json | 200 ++++++++++++++++++ .../49/actual.js | 1 + .../49/expected.json | 119 +++++++++++ .../5/actual.js | 1 + .../5/expected.json | 119 +++++++++++ .../50/actual.js | 1 + .../50/expected.json | 160 ++++++++++++++ .../51/actual.js | 1 + .../51/expected.json | 160 ++++++++++++++ .../52/actual.js | 1 + .../52/expected.json | 200 ++++++++++++++++++ .../53/actual.js | 1 + .../53/expected.json | 119 +++++++++++ .../54/actual.js | 1 + .../54/expected.json | 160 ++++++++++++++ .../55/actual.js | 1 + .../55/expected.json | 160 ++++++++++++++ .../56/actual.js | 1 + .../56/expected.json | 200 ++++++++++++++++++ .../57/actual.js | 1 + .../57/expected.json | 119 +++++++++++ .../58/actual.js | 1 + .../58/expected.json | 160 ++++++++++++++ .../59/actual.js | 1 + .../59/expected.json | 160 ++++++++++++++ .../6/actual.js | 1 + .../6/expected.json | 160 ++++++++++++++ .../60/actual.js | 1 + .../60/expected.json | 200 ++++++++++++++++++ .../61/actual.js | 1 + .../61/expected.json | 119 +++++++++++ .../62/actual.js | 1 + .../62/expected.json | 160 ++++++++++++++ .../63/actual.js | 1 + .../63/expected.json | 160 ++++++++++++++ .../64/actual.js | 1 + .../64/expected.json | 200 ++++++++++++++++++ .../65/actual.js | 1 + .../65/expected.json | 119 +++++++++++ .../66/actual.js | 1 + .../66/expected.json | 160 ++++++++++++++ .../67/actual.js | 1 + .../67/expected.json | 160 ++++++++++++++ .../68/actual.js | 1 + .../68/expected.json | 200 ++++++++++++++++++ .../7/actual.js | 1 + .../7/expected.json | 160 ++++++++++++++ .../8/actual.js | 1 + .../8/expected.json | 200 ++++++++++++++++++ .../9/actual.js | 1 + .../9/expected.json | 119 +++++++++++ .../options.json | 3 + .../1/actual.js | 1 + .../1/options.json | 6 + .../10/actual.js | 1 + .../10/options.json | 6 + .../11/actual.js | 1 + .../11/options.json | 6 + .../12/actual.js | 1 + .../12/options.json | 6 + .../13/actual.js | 1 + .../13/options.json | 6 + .../14/actual.js | 1 + .../14/options.json | 6 + .../15/actual.js | 1 + .../15/options.json | 6 + .../16/actual.js | 1 + .../16/options.json | 6 + .../17/actual.js | 1 + .../17/options.json | 6 + .../18/actual.js | 1 + .../18/options.json | 6 + .../19/actual.js | 1 + .../19/options.json | 6 + .../2/actual.js | 1 + .../2/options.json | 6 + .../20/actual.js | 1 + .../20/options.json | 6 + .../21/actual.js | 1 + .../21/options.json | 6 + .../22/actual.js | 1 + .../22/options.json | 6 + .../23/actual.js | 1 + .../23/options.json | 6 + .../24/actual.js | 1 + .../24/options.json | 6 + .../25/actual.js | 1 + .../25/options.json | 6 + .../26/actual.js | 1 + .../26/options.json | 6 + .../27/actual.js | 1 + .../27/options.json | 6 + .../28/actual.js | 1 + .../28/options.json | 6 + .../29/actual.js | 1 + .../29/options.json | 6 + .../3/actual.js | 1 + .../3/options.json | 6 + .../30/actual.js | 1 + .../30/options.json | 6 + .../31/actual.js | 1 + .../31/options.json | 6 + .../32/actual.js | 1 + .../32/options.json | 6 + .../33/actual.js | 1 + .../33/options.json | 6 + .../34/actual.js | 1 + .../34/options.json | 6 + .../35/actual.js | 1 + .../35/options.json | 6 + .../36/actual.js | 1 + .../36/options.json | 6 + .../37/actual.js | 1 + .../37/options.json | 6 + .../38/actual.js | 1 + .../38/options.json | 6 + .../39/actual.js | 1 + .../39/options.json | 6 + .../4/actual.js | 1 + .../4/options.json | 6 + .../40/actual.js | 1 + .../40/options.json | 6 + .../41/actual.js | 1 + .../41/options.json | 6 + .../42/actual.js | 1 + .../42/options.json | 6 + .../43/actual.js | 1 + .../43/options.json | 6 + .../44/actual.js | 1 + .../44/options.json | 6 + .../45/actual.js | 1 + .../45/options.json | 6 + .../46/actual.js | 1 + .../46/options.json | 6 + .../47/actual.js | 1 + .../47/options.json | 6 + .../48/actual.js | 1 + .../48/options.json | 6 + .../49/actual.js | 1 + .../49/options.json | 6 + .../5/actual.js | 1 + .../5/options.json | 6 + .../50/actual.js | 1 + .../50/options.json | 6 + .../51/actual.js | 1 + .../51/options.json | 6 + .../52/actual.js | 1 + .../52/options.json | 6 + .../53/actual.js | 1 + .../53/options.json | 6 + .../54/actual.js | 1 + .../54/options.json | 6 + .../55/actual.js | 1 + .../55/options.json | 6 + .../56/actual.js | 1 + .../56/options.json | 6 + .../57/actual.js | 1 + .../57/options.json | 6 + .../58/actual.js | 1 + .../58/options.json | 6 + .../59/actual.js | 1 + .../59/options.json | 6 + .../6/actual.js | 1 + .../6/options.json | 6 + .../60/actual.js | 1 + .../60/options.json | 6 + .../61/actual.js | 1 + .../61/options.json | 6 + .../62/actual.js | 1 + .../62/options.json | 6 + .../63/actual.js | 1 + .../63/options.json | 6 + .../64/actual.js | 1 + .../64/options.json | 6 + .../65/actual.js | 1 + .../65/options.json | 6 + .../66/actual.js | 1 + .../66/options.json | 6 + .../67/actual.js | 1 + .../67/options.json | 6 + .../68/actual.js | 1 + .../68/options.json | 6 + .../7/actual.js | 1 + .../7/options.json | 6 + .../8/actual.js | 1 + .../8/options.json | 6 + .../9/actual.js | 1 + .../9/options.json | 6 + 290 files changed, 11491 insertions(+), 38 deletions(-) create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/expected.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/actual.js create mode 100644 test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json diff --git a/README.md b/README.md index 57d971ad03..39188bb475 100644 --- a/README.md +++ b/README.md @@ -134,3 +134,4 @@ require("babylon").parse("code", { - `functionBind` - `functionSent` - `dynamicImport` + - `templateInvalidEscapes` diff --git a/ast/spec.md b/ast/spec.md index c03bfad24f..0ff1c87c51 100644 --- a/ast/spec.md +++ b/ast/spec.md @@ -946,7 +946,7 @@ interface TemplateElement <: Node { type: "TemplateElement"; tail: boolean; value: { - cooked: string; + cooked: string | null; raw: string; }; } diff --git a/src/parser/expression.js b/src/parser/expression.js index 5ec827549e..f974459462 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -317,7 +317,7 @@ pp.parseSubscripts = function (base, startPos, startLoc, noCalls) { } else if (this.match(tt.backQuote)) { const node = this.startNodeAt(startPos, startLoc); node.tag = base; - node.quasi = this.parseTemplate(); + node.quasi = this.parseTemplate(true); base = this.finishNode(node, "TaggedTemplateExpression"); } else { return base; @@ -506,7 +506,7 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { return this.parseNew(); case tt.backQuote: - return this.parseTemplate(); + return this.parseTemplate(false); case tt.doubleColon: node = this.startNode(); @@ -685,8 +685,15 @@ pp.parseNew = function () { // Parse template expression. -pp.parseTemplateElement = function () { +pp.parseTemplateElement = function (isTagged) { const elem = this.startNode(); + if (this.state.value === null) { + if (!isTagged || !this.hasPlugin("templateInvalidEscapes")) { + this.raise(this.state.invalidTemplateEscapePosition, "Invalid escape sequence in template"); + } else { + this.state.invalidTemplateEscapePosition = null; + } + } elem.value = { raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), cooked: this.state.value @@ -696,17 +703,17 @@ pp.parseTemplateElement = function () { return this.finishNode(elem, "TemplateElement"); }; -pp.parseTemplate = function () { +pp.parseTemplate = function (isTagged) { const node = this.startNode(); this.next(); node.expressions = []; - let curElt = this.parseTemplateElement(); + let curElt = this.parseTemplateElement(isTagged); node.quasis = [curElt]; while (!curElt.tail) { this.expect(tt.dollarBraceL); node.expressions.push(this.parseExpression()); this.expect(tt.braceR); - node.quasis.push(curElt = this.parseTemplateElement()); + node.quasis.push(curElt = this.parseTemplateElement(isTagged)); } this.next(); return this.finishNode(node, "TemplateLiteral"); diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index 4c35054c2b..a058ba91a5 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -599,17 +599,26 @@ export default class Tokenizer { // Read a string value, interpreting backslash-escapes. - readCodePoint() { + readCodePoint(throwOnInvalid) { const ch = this.input.charCodeAt(this.state.pos); let code; - if (ch === 123) { + if (ch === 123) { // '{' const codePos = ++this.state.pos; - code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos); + code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, throwOnInvalid); ++this.state.pos; - if (code > 0x10FFFF) this.raise(codePos, "Code point out of bounds"); + if (code === null) { + --this.state.invalidTemplateEscapePosition; // to point to the '\'' instead of the 'u' + } else if (code > 0x10FFFF) { + if (throwOnInvalid) { + this.raise(codePos, "Code point out of bounds"); + } else { + this.state.invalidTemplateEscapePosition = codePos - 2; + return null; + } + } } else { - code = this.readHexChar(4); + code = this.readHexChar(4, throwOnInvalid); } return code; } @@ -636,7 +645,7 @@ export default class Tokenizer { // Reads template string tokens. readTmplToken() { - let out = "", chunkStart = this.state.pos; + let out = "", chunkStart = this.state.pos, containsInvalid = false; for (;;) { if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated template"); const ch = this.input.charCodeAt(this.state.pos); @@ -651,11 +660,16 @@ export default class Tokenizer { } } out += this.input.slice(chunkStart, this.state.pos); - return this.finishToken(tt.template, out); + return this.finishToken(tt.template, containsInvalid ? null : out); } if (ch === 92) { // '\' out += this.input.slice(chunkStart, this.state.pos); - out += this.readEscapedChar(true); + const escaped = this.readEscapedChar(true); + if (escaped === null) { + containsInvalid = true; + } else { + out += escaped; + } chunkStart = this.state.pos; } else if (isNewLine(ch)) { out += this.input.slice(chunkStart, this.state.pos); @@ -682,13 +696,20 @@ export default class Tokenizer { // Used to read escaped characters readEscapedChar(inTemplate) { + const throwOnInvalid = !inTemplate; const ch = this.input.charCodeAt(++this.state.pos); ++this.state.pos; switch (ch) { case 110: return "\n"; // 'n' -> '\n' case 114: return "\r"; // 'r' -> '\r' - case 120: return String.fromCharCode(this.readHexChar(2)); // 'x' - case 117: return codePointToString(this.readCodePoint()); // 'u' + case 120: { // 'x' + const code = this.readHexChar(2, throwOnInvalid); + return code === null ? null : String.fromCharCode(code); + } + case 117: { // 'u' + const code = this.readCodePoint(throwOnInvalid); + return code === null ? null : codePointToString(code); + } case 116: return "\t"; // 't' -> '\t' case 98: return "\b"; // 'b' -> '\b' case 118: return "\u000b"; // 'v' -> '\u000b' @@ -700,6 +721,7 @@ export default class Tokenizer { return ""; default: if (ch >= 48 && ch <= 55) { + const codePos = this.state.pos - 1; let octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0]; let octal = parseInt(octalStr, 8); if (octal > 255) { @@ -707,12 +729,16 @@ export default class Tokenizer { octal = parseInt(octalStr, 8); } if (octal > 0) { - if (!this.state.containsOctal) { + if (inTemplate) { + this.state.invalidTemplateEscapePosition = codePos; + return null; + } else if (this.state.strict) { + this.raise(codePos, "Octal literal in strict mode"); + } else if (!this.state.containsOctal) { + // These properties are only used to throw an error for an octal which occurs + // in a directive which occurs prior to a "use strict" directive. this.state.containsOctal = true; - this.state.octalPosition = this.state.pos - 2; - } - if (this.state.strict || inTemplate) { - this.raise(this.state.pos - 2, "Octal literal in strict mode"); + this.state.octalPosition = codePos; } } this.state.pos += octalStr.length - 1; @@ -722,12 +748,19 @@ export default class Tokenizer { } } - // Used to read character escape sequences ('\x', '\u', '\U'). + // Used to read character escape sequences ('\x', '\u'). - readHexChar(len) { + readHexChar(len, throwOnInvalid) { const codePos = this.state.pos; const n = this.readInt(16, len); - if (n === null) this.raise(codePos, "Bad character escape sequence"); + if (n === null) { + if (throwOnInvalid) { + this.raise(codePos, "Bad character escape sequence"); + } else { + this.state.pos = codePos - 1; + this.state.invalidTemplateEscapePosition = codePos - 1; + } + } return n; } @@ -755,7 +788,7 @@ export default class Tokenizer { } ++this.state.pos; - const esc = this.readCodePoint(); + const esc = this.readCodePoint(true); if (!(first ? isIdentifierStart : isIdentifierChar)(esc, true)) { this.raise(escStart, "Invalid Unicode escape"); } diff --git a/src/tokenizer/state.js b/src/tokenizer/state.js index 371bcdfd7d..2e35b3ac4f 100644 --- a/src/tokenizer/state.js +++ b/src/tokenizer/state.js @@ -50,6 +50,8 @@ export default class State { this.containsEsc = this.containsOctal = false; this.octalPosition = null; + this.invalidTemplateEscapePosition = null; + this.exportedIdentifiers = []; return this; diff --git a/test/fixtures/core/uncategorised/499/options.json b/test/fixtures/core/uncategorised/499/options.json index 68bfd75832..11a57d6c56 100644 --- a/test/fixtures/core/uncategorised/499/options.json +++ b/test/fixtures/core/uncategorised/499/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:34)" + "throws": "Octal literal in strict mode (1:35)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/501/options.json b/test/fixtures/core/uncategorised/501/options.json index fa3a33b55e..2984958689 100644 --- a/test/fixtures/core/uncategorised/501/options.json +++ b/test/fixtures/core/uncategorised/501/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:37)" + "throws": "Octal literal in strict mode (1:38)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/503/options.json b/test/fixtures/core/uncategorised/503/options.json index e689079a79..e92ad336dd 100644 --- a/test/fixtures/core/uncategorised/503/options.json +++ b/test/fixtures/core/uncategorised/503/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:68)" + "throws": "Octal literal in strict mode (1:69)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/290/options.json b/test/fixtures/es2015/uncategorised/290/options.json index 890fce8204..8513ff0bed 100644 --- a/test/fixtures/es2015/uncategorised/290/options.json +++ b/test/fixtures/es2015/uncategorised/290/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:22)" + "throws": "Invalid escape sequence in template (1:23)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/339/options.json b/test/fixtures/es2015/uncategorised/339/options.json index 857b44ba21..3ae5cb6c96 100644 --- a/test/fixtures/es2015/uncategorised/339/options.json +++ b/test/fixtures/es2015/uncategorised/339/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:1)" + "throws": "Invalid escape sequence in template (1:2)" } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json b/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json index 857b44ba21..3ae5cb6c96 100644 --- a/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json +++ b/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:1)" + "throws": "Invalid escape sequence in template (1:2)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json index 91bbdfe83f..61a5834b63 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:1)" + "throws": "Octal literal in strict mode (1:2)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json index 68bfd75832..11a57d6c56 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:34)" + "throws": "Octal literal in strict mode (1:35)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json index fa3a33b55e..2984958689 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:37)" + "throws": "Octal literal in strict mode (1:38)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json index ae2bfab55c..d094fe0284 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:35)" + "throws": "Octal literal in strict mode (1:36)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json index ae2bfab55c..d094fe0284 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:35)" + "throws": "Octal literal in strict mode (1:36)" } diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json index e689079a79..e92ad336dd 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json @@ -1,3 +1,3 @@ { - "throws": "Octal literal in strict mode (1:68)" + "throws": "Octal literal in strict mode (1:69)" } \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/actual.js new file mode 100644 index 0000000000..e62c7abcaf --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/actual.js @@ -0,0 +1 @@ +sampleTag`\01` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/expected.json new file mode 100644 index 0000000000..d8b75cc1d0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/actual.js new file mode 100644 index 0000000000..1b7671b74a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/actual.js @@ -0,0 +1 @@ +sampleTag`\xg${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/expected.json new file mode 100644 index 0000000000..6ef94ad9bd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/actual.js new file mode 100644 index 0000000000..87bfd46be5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\xg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/expected.json new file mode 100644 index 0000000000..1cf6041972 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/actual.js new file mode 100644 index 0000000000..eed8a8c9a1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\xg${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/expected.json new file mode 100644 index 0000000000..eaa8c4ab42 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/actual.js new file mode 100644 index 0000000000..28ab31c9c1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/actual.js @@ -0,0 +1 @@ +sampleTag`\xAg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json new file mode 100644 index 0000000000..6422cab83c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js new file mode 100644 index 0000000000..cc0ec32af0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/actual.js @@ -0,0 +1 @@ +sampleTag`\xAg${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/expected.json new file mode 100644 index 0000000000..253459c464 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/actual.js new file mode 100644 index 0000000000..cd57463528 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\xAg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/expected.json new file mode 100644 index 0000000000..ec73dac5d8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/actual.js new file mode 100644 index 0000000000..04cdb9e9b2 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\xAg${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/expected.json new file mode 100644 index 0000000000..bf367875f1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/actual.js new file mode 100644 index 0000000000..191ca653c0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/actual.js @@ -0,0 +1 @@ +sampleTag`\u0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/expected.json new file mode 100644 index 0000000000..db6bfd7588 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/actual.js new file mode 100644 index 0000000000..ab93eda9d9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/actual.js @@ -0,0 +1 @@ +sampleTag`\u0${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/expected.json new file mode 100644 index 0000000000..7d1d4ecac2 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/actual.js new file mode 100644 index 0000000000..d26dfc60e7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/expected.json new file mode 100644 index 0000000000..30b397ba11 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/actual.js new file mode 100644 index 0000000000..4fb52640f5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/actual.js @@ -0,0 +1 @@ +sampleTag`\01${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/expected.json new file mode 100644 index 0000000000..dc2581302c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/actual.js new file mode 100644 index 0000000000..7b0f56fa2a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u0${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/expected.json new file mode 100644 index 0000000000..5995e5c491 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/actual.js new file mode 100644 index 0000000000..6aa1d27769 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/actual.js @@ -0,0 +1 @@ +sampleTag`\u0g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/expected.json new file mode 100644 index 0000000000..3eff694145 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/actual.js new file mode 100644 index 0000000000..44eb637a41 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/actual.js @@ -0,0 +1 @@ +sampleTag`\u0g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/expected.json new file mode 100644 index 0000000000..fcfe7dbcd0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/actual.js new file mode 100644 index 0000000000..30d440cd97 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u0g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/expected.json new file mode 100644 index 0000000000..aa1740dac3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/actual.js new file mode 100644 index 0000000000..59d991056a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u0g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/expected.json new file mode 100644 index 0000000000..39b3bb484e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/actual.js new file mode 100644 index 0000000000..05d2fafe66 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/actual.js @@ -0,0 +1 @@ +sampleTag`\u00g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/expected.json new file mode 100644 index 0000000000..f978e9e2bb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/actual.js new file mode 100644 index 0000000000..525cfc3d26 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/actual.js @@ -0,0 +1 @@ +sampleTag`\u00g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/expected.json new file mode 100644 index 0000000000..02603f46cd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/actual.js new file mode 100644 index 0000000000..b5687e98f8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u00g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/expected.json new file mode 100644 index 0000000000..bda12c9651 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/actual.js new file mode 100644 index 0000000000..39b7ca87b5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u00g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/expected.json new file mode 100644 index 0000000000..2ee6bf6d75 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/expected.json @@ -0,0 +1,200 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/actual.js new file mode 100644 index 0000000000..a409ba9123 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/actual.js @@ -0,0 +1 @@ +sampleTag`\u000g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/expected.json new file mode 100644 index 0000000000..ab787c76b0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/actual.js new file mode 100644 index 0000000000..592b5c6eb8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\01` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/expected.json new file mode 100644 index 0000000000..82a87607c9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/actual.js new file mode 100644 index 0000000000..c1b737a8de --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/actual.js @@ -0,0 +1 @@ +sampleTag`\u000g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/expected.json new file mode 100644 index 0000000000..5467e09a34 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/actual.js new file mode 100644 index 0000000000..1936125122 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u000g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/expected.json new file mode 100644 index 0000000000..7792df9415 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/actual.js new file mode 100644 index 0000000000..8920322734 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u000g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/expected.json new file mode 100644 index 0000000000..00a0ad78bc --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/actual.js new file mode 100644 index 0000000000..ff7451e4f7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/actual.js @@ -0,0 +1 @@ +sampleTag`\u{}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/expected.json new file mode 100644 index 0000000000..11d9cd92b3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/actual.js new file mode 100644 index 0000000000..b936b2aa79 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/actual.js @@ -0,0 +1 @@ +sampleTag`\u{}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/expected.json new file mode 100644 index 0000000000..072eac4db4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/actual.js new file mode 100644 index 0000000000..af58ad5476 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/expected.json new file mode 100644 index 0000000000..f6e57d84f1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/actual.js new file mode 100644 index 0000000000..9809674f2d --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/expected.json new file mode 100644 index 0000000000..5a52cbb588 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/actual.js new file mode 100644 index 0000000000..f3b7c60be7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/actual.js @@ -0,0 +1 @@ +sampleTag`\u{-0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/expected.json new file mode 100644 index 0000000000..b6ad827a92 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/actual.js new file mode 100644 index 0000000000..2de362b243 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/actual.js @@ -0,0 +1 @@ +sampleTag`\u{-0}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/expected.json new file mode 100644 index 0000000000..b25f264baf --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/actual.js new file mode 100644 index 0000000000..aec71687c2 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{-0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/expected.json new file mode 100644 index 0000000000..d0ee5e2b4f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/actual.js new file mode 100644 index 0000000000..4e72a53bb6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\01${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/expected.json new file mode 100644 index 0000000000..3c240cbca5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/actual.js new file mode 100644 index 0000000000..4884482024 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{-0}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/expected.json new file mode 100644 index 0000000000..c5c6235df6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/actual.js new file mode 100644 index 0000000000..0dbd371767 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/actual.js @@ -0,0 +1 @@ +sampleTag`\u{g}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/expected.json new file mode 100644 index 0000000000..70facd5b6a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/actual.js new file mode 100644 index 0000000000..506ec11d83 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/actual.js @@ -0,0 +1 @@ +sampleTag`\u{g}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/expected.json new file mode 100644 index 0000000000..4dd20c77bc --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/actual.js new file mode 100644 index 0000000000..2f863994a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{g}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/expected.json new file mode 100644 index 0000000000..d75d926a77 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/actual.js new file mode 100644 index 0000000000..96f9d738d9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{g}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/expected.json new file mode 100644 index 0000000000..811cbc9664 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/expected.json @@ -0,0 +1,200 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/actual.js new file mode 100644 index 0000000000..7be4c3fa0f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/actual.js @@ -0,0 +1 @@ +sampleTag`\u{` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/expected.json new file mode 100644 index 0000000000..7e104de733 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/actual.js new file mode 100644 index 0000000000..000f2fbf37 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/actual.js @@ -0,0 +1 @@ +sampleTag`\u{${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/expected.json new file mode 100644 index 0000000000..3f850af6f9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/actual.js new file mode 100644 index 0000000000..74d5b29f61 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/expected.json new file mode 100644 index 0000000000..4d25257bf2 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/actual.js new file mode 100644 index 0000000000..849edc693e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/expected.json new file mode 100644 index 0000000000..54b4914e13 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/actual.js new file mode 100644 index 0000000000..9575b3d816 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\\` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/expected.json new file mode 100644 index 0000000000..5dc69624b3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/actual.js new file mode 100644 index 0000000000..00c3211a93 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/actual.js @@ -0,0 +1 @@ +sampleTag`\1` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json new file mode 100644 index 0000000000..bf13103e1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js new file mode 100644 index 0000000000..a931f49dc3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\\${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/expected.json new file mode 100644 index 0000000000..88982b42de --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/actual.js new file mode 100644 index 0000000000..6c51808602 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\\` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/expected.json new file mode 100644 index 0000000000..999202808b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/actual.js new file mode 100644 index 0000000000..71c32286f8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\\${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/expected.json new file mode 100644 index 0000000000..ff94ba4145 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/expected.json @@ -0,0 +1,200 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/actual.js new file mode 100644 index 0000000000..dadcb43b49 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\`` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/expected.json new file mode 100644 index 0000000000..bd743338a8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/actual.js new file mode 100644 index 0000000000..9d9f26b33b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\`${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/expected.json new file mode 100644 index 0000000000..1ef2fcc477 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/actual.js new file mode 100644 index 0000000000..e108605dd8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\`` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/expected.json new file mode 100644 index 0000000000..db9472adc3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/actual.js new file mode 100644 index 0000000000..c53213af0b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\`${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/expected.json new file mode 100644 index 0000000000..a29dca62cb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/expected.json @@ -0,0 +1,200 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/actual.js new file mode 100644 index 0000000000..35fb813aeb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/actual.js @@ -0,0 +1 @@ +sampleTag`\u{0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/expected.json new file mode 100644 index 0000000000..440e1e7b6c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/actual.js new file mode 100644 index 0000000000..e6a45880f4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/actual.js @@ -0,0 +1 @@ +sampleTag`\u{0${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/expected.json new file mode 100644 index 0000000000..d5c6e26513 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/actual.js new file mode 100644 index 0000000000..8c3d8e2394 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/expected.json new file mode 100644 index 0000000000..ea9c9bb696 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/actual.js new file mode 100644 index 0000000000..636accd45c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/actual.js @@ -0,0 +1 @@ +sampleTag`\1${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/expected.json new file mode 100644 index 0000000000..e756aa3c50 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/actual.js new file mode 100644 index 0000000000..3c91289aa4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{0${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/expected.json new file mode 100644 index 0000000000..d77b26a5d6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/actual.js new file mode 100644 index 0000000000..a04b3de90f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\u{0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json new file mode 100644 index 0000000000..4d954dc2d3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json @@ -0,0 +1,119 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js new file mode 100644 index 0000000000..a01abfbccb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/actual.js @@ -0,0 +1 @@ +sampleTag`\u{\u{0}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/expected.json new file mode 100644 index 0000000000..a4ab688484 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/actual.js new file mode 100644 index 0000000000..7180334fe7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\u{0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/expected.json new file mode 100644 index 0000000000..d6f59b6cd6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/actual.js new file mode 100644 index 0000000000..913257ec23 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{\u{0}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/expected.json new file mode 100644 index 0000000000..b3cd32eb66 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/actual.js new file mode 100644 index 0000000000..57cee514aa --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/actual.js @@ -0,0 +1 @@ +sampleTag`\u{110000}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/expected.json new file mode 100644 index 0000000000..d381bed78f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/expected.json @@ -0,0 +1,119 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/actual.js new file mode 100644 index 0000000000..1021623c19 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/actual.js @@ -0,0 +1 @@ +sampleTag`\u{110000}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/expected.json new file mode 100644 index 0000000000..b6d1bad8e0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/actual.js new file mode 100644 index 0000000000..28d404e2e8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{110000}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/expected.json new file mode 100644 index 0000000000..9f89295266 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/expected.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/actual.js new file mode 100644 index 0000000000..ddfde0880a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\u{110000}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/expected.json new file mode 100644 index 0000000000..59ad74af19 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/expected.json @@ -0,0 +1,200 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/actual.js new file mode 100644 index 0000000000..7ae506f9be --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\1` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/expected.json new file mode 100644 index 0000000000..8dd1cb7248 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/expected.json @@ -0,0 +1,160 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/actual.js new file mode 100644 index 0000000000..808e93f360 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/actual.js @@ -0,0 +1 @@ +sampleTag`left${0}\1${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/expected.json new file mode 100644 index 0000000000..8fd7e0ab30 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/expected.json @@ -0,0 +1,200 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/actual.js new file mode 100644 index 0000000000..6a82dddf36 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/actual.js @@ -0,0 +1 @@ +sampleTag`\xg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/expected.json new file mode 100644 index 0000000000..2306ad4846 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json new file mode 100644 index 0000000000..eb93fe5b94 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["templateInvalidEscapes"] +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/actual.js new file mode 100644 index 0000000000..38c654a5b4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/actual.js @@ -0,0 +1 @@ +`\01` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/actual.js new file mode 100644 index 0000000000..f9b52ebde0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/actual.js @@ -0,0 +1 @@ +`\xg${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/actual.js new file mode 100644 index 0000000000..a0c30ccebf --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/actual.js @@ -0,0 +1 @@ +`left${0}\xg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/actual.js new file mode 100644 index 0000000000..b951c4896c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/actual.js @@ -0,0 +1 @@ +`left${0}\xg${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/actual.js new file mode 100644 index 0000000000..59702c7be1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/actual.js @@ -0,0 +1 @@ +`\xAg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/actual.js new file mode 100644 index 0000000000..2b1e66e6c5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/actual.js @@ -0,0 +1 @@ +`\xAg${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/actual.js new file mode 100644 index 0000000000..1742efdd1d --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/actual.js @@ -0,0 +1 @@ +`left${0}\xAg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/actual.js new file mode 100644 index 0000000000..0b999a4306 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/actual.js @@ -0,0 +1 @@ +`left${0}\xAg${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/actual.js new file mode 100644 index 0000000000..5750e28788 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/actual.js @@ -0,0 +1 @@ +`\u0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/actual.js new file mode 100644 index 0000000000..8f0e13d9f8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/actual.js @@ -0,0 +1 @@ +`\u0${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/actual.js new file mode 100644 index 0000000000..84fc9009b6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/actual.js @@ -0,0 +1 @@ +`left${0}\u0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/actual.js new file mode 100644 index 0000000000..629c7645c9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/actual.js @@ -0,0 +1 @@ +`\01${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/actual.js new file mode 100644 index 0000000000..66024330d3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/actual.js @@ -0,0 +1 @@ +`left${0}\u0${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/actual.js new file mode 100644 index 0000000000..55cd59a2c7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/actual.js @@ -0,0 +1 @@ +`\u0g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/actual.js new file mode 100644 index 0000000000..0968b3b2b0 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/actual.js @@ -0,0 +1 @@ +`\u0g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/actual.js new file mode 100644 index 0000000000..39b67a92dd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/actual.js @@ -0,0 +1 @@ +`left${0}\u0g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/actual.js new file mode 100644 index 0000000000..d3656d3d08 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/actual.js @@ -0,0 +1 @@ +`left${0}\u0g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/actual.js new file mode 100644 index 0000000000..f401af6e63 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/actual.js @@ -0,0 +1 @@ +`\u00g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/actual.js new file mode 100644 index 0000000000..bbd2bb505b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/actual.js @@ -0,0 +1 @@ +`\u00g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/actual.js new file mode 100644 index 0000000000..710a43999a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/actual.js @@ -0,0 +1 @@ +`left${0}\u00g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/actual.js new file mode 100644 index 0000000000..f4a5e3653a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/actual.js @@ -0,0 +1 @@ +`left${0}\u00g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/actual.js new file mode 100644 index 0000000000..4c4daa380e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/actual.js @@ -0,0 +1 @@ +`\u000g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/actual.js new file mode 100644 index 0000000000..3663eaffcc --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/actual.js @@ -0,0 +1 @@ +`left${0}\01` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/actual.js new file mode 100644 index 0000000000..d0525f75cb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/actual.js @@ -0,0 +1 @@ +`\u000g${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/actual.js new file mode 100644 index 0000000000..981b65ab1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/actual.js @@ -0,0 +1 @@ +`left${0}\u000g` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/actual.js new file mode 100644 index 0000000000..c6441febbd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/actual.js @@ -0,0 +1 @@ +`left${0}\u000g${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/actual.js new file mode 100644 index 0000000000..90ace87a84 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/actual.js @@ -0,0 +1 @@ +`\u{}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/actual.js new file mode 100644 index 0000000000..eadeb7b3cd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/actual.js @@ -0,0 +1 @@ +`\u{}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/actual.js new file mode 100644 index 0000000000..cd7b76fe4f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/actual.js @@ -0,0 +1 @@ +`left${0}\u{}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/actual.js new file mode 100644 index 0000000000..79a1eedc9a --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/actual.js @@ -0,0 +1 @@ +`left${0}\u{}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/actual.js new file mode 100644 index 0000000000..d7c716f1b5 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/actual.js @@ -0,0 +1 @@ +`\u{-0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/actual.js new file mode 100644 index 0000000000..da568ab1dd --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/actual.js @@ -0,0 +1 @@ +`\u{-0}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/actual.js new file mode 100644 index 0000000000..a564107d91 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/actual.js @@ -0,0 +1 @@ +`left${0}\u{-0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/actual.js new file mode 100644 index 0000000000..f0ea873a5d --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/actual.js @@ -0,0 +1 @@ +`left${0}\01${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/actual.js new file mode 100644 index 0000000000..66ecba8b94 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/actual.js @@ -0,0 +1 @@ +`left${0}\u{-0}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/actual.js new file mode 100644 index 0000000000..a4b058d036 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/actual.js @@ -0,0 +1 @@ +`\u{g}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/actual.js new file mode 100644 index 0000000000..05dd670eb9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/actual.js @@ -0,0 +1 @@ +`\u{g}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/actual.js new file mode 100644 index 0000000000..0c02fbcc5b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/actual.js @@ -0,0 +1 @@ +`left${0}\u{g}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/actual.js new file mode 100644 index 0000000000..f81c6beccc --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/actual.js @@ -0,0 +1 @@ +`left${0}\u{g}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/actual.js new file mode 100644 index 0000000000..2e6b74b44e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/actual.js @@ -0,0 +1 @@ +`\u{` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/actual.js new file mode 100644 index 0000000000..162c16696d --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/actual.js @@ -0,0 +1 @@ +`\u{${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/actual.js new file mode 100644 index 0000000000..72bc784142 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/actual.js @@ -0,0 +1 @@ +`left${0}\u{` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/actual.js new file mode 100644 index 0000000000..af0cefff92 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/actual.js @@ -0,0 +1 @@ +`left${0}\u{${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/actual.js new file mode 100644 index 0000000000..512229f60c --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/actual.js @@ -0,0 +1 @@ +`\u{\\` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/actual.js new file mode 100644 index 0000000000..a4ffac63b8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/actual.js @@ -0,0 +1 @@ +`\1` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/actual.js new file mode 100644 index 0000000000..2811cdfcf9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/actual.js @@ -0,0 +1 @@ +`\u{\\${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/actual.js new file mode 100644 index 0000000000..1f3f5e3640 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/actual.js @@ -0,0 +1 @@ +`left${0}\u{\\` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/actual.js new file mode 100644 index 0000000000..fd255a9f91 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/actual.js @@ -0,0 +1 @@ +`left${0}\u{\\${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/actual.js new file mode 100644 index 0000000000..77e7e029e4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/actual.js @@ -0,0 +1 @@ +`\u{\`` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/actual.js new file mode 100644 index 0000000000..843e2f4031 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/actual.js @@ -0,0 +1 @@ +`\u{\`${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/actual.js new file mode 100644 index 0000000000..08c9e10363 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/actual.js @@ -0,0 +1 @@ +`left${0}\u{\`` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/actual.js new file mode 100644 index 0000000000..d6b1f25a7e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/actual.js @@ -0,0 +1 @@ +`left${0}\u{\`${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/actual.js new file mode 100644 index 0000000000..af2be992b1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/actual.js @@ -0,0 +1 @@ +`\u{0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/actual.js new file mode 100644 index 0000000000..6612fdbb02 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/actual.js @@ -0,0 +1 @@ +`\u{0${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/actual.js new file mode 100644 index 0000000000..983aae670e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/actual.js @@ -0,0 +1 @@ +`left${0}\u{0` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/actual.js new file mode 100644 index 0000000000..554c901c69 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/actual.js @@ -0,0 +1 @@ +`\1${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/actual.js new file mode 100644 index 0000000000..611f774bdc --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/actual.js @@ -0,0 +1 @@ +`left${0}\u{0${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/actual.js new file mode 100644 index 0000000000..6b91a4e8c7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/actual.js @@ -0,0 +1 @@ +`\u{\u{0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/actual.js new file mode 100644 index 0000000000..18df761fc1 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/actual.js @@ -0,0 +1 @@ +`\u{\u{0}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/actual.js new file mode 100644 index 0000000000..5d54005046 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/actual.js @@ -0,0 +1 @@ +`left${0}\u{\u{0}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/actual.js new file mode 100644 index 0000000000..e5989149e9 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/actual.js @@ -0,0 +1 @@ +`left${0}\u{\u{0}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/actual.js new file mode 100644 index 0000000000..63b6915978 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/actual.js @@ -0,0 +1 @@ +`\u{110000}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/actual.js new file mode 100644 index 0000000000..4fa89bb1d3 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/actual.js @@ -0,0 +1 @@ +`\u{110000}${0}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/actual.js new file mode 100644 index 0000000000..9d9819b1eb --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/actual.js @@ -0,0 +1 @@ +`left${0}\u{110000}` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/actual.js new file mode 100644 index 0000000000..0ff67f82a6 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/actual.js @@ -0,0 +1 @@ +`left${0}\u{110000}${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/actual.js new file mode 100644 index 0000000000..03b6467b6f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/actual.js @@ -0,0 +1 @@ +`left${0}\1` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/actual.js new file mode 100644 index 0000000000..384fad327e --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/actual.js @@ -0,0 +1 @@ +`left${0}\1${1}right` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json new file mode 100644 index 0000000000..06ac8464d7 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:10)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/actual.js b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/actual.js new file mode 100644 index 0000000000..a8dec8c005 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/actual.js @@ -0,0 +1 @@ +`\xg` \ No newline at end of file diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json new file mode 100644 index 0000000000..1cd5cd7bc8 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json @@ -0,0 +1,6 @@ +{ + "throws": "Invalid escape sequence in template (1:2)", + "plugins": [ + "templateInvalidEscapes" + ] +} \ No newline at end of file From 964105e3fbd2084be0992bfdff3373c064e3d630 Mon Sep 17 00:00:00 2001 From: Arshabh Kumar Agarwal Date: Wed, 22 Mar 2017 03:14:21 +0530 Subject: [PATCH 057/105] Improves error message when super is called outside of constructor (#408) --- src/parser/expression.js | 2 +- .../direct-super-outside-constructor/options.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser/expression.js b/src/parser/expression.js index f974459462..5c9ebd588f 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -392,7 +392,7 @@ pp.parseExprAtom = function (refShorthandDefaultPos) { this.unexpected(); } if (this.match(tt.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) { - this.raise(node.start, "super() outside of class constructor"); + this.raise(node.start, "super() is only valid inside a class constructor. Make sure the method name is spelled exactly as 'constructor'."); } return this.finishNode(node, "Super"); diff --git a/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json b/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json index 476bc13a2b..faef53359b 100644 --- a/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json +++ b/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json @@ -1,3 +1,3 @@ { - "throws": "super() outside of class constructor (2:8)" -} \ No newline at end of file + "throws": "super() is only valid inside a class constructor. Make sure the method name is spelled exactly as 'constructor'. (2:8)" +} From ad1eb149fe98898d652c37fd57ee062ac3318747 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 22 Mar 2017 00:07:32 -0400 Subject: [PATCH 058/105] update lock [skip ci] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6ceaa3310..50d3c2e0c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1783,9 +1783,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.41.0: - version "0.41.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.41.0.tgz#8badac9a19da45004997e599bd316518db489b2e" +flow-bin@^0.42.0: + version "0.42.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.42.0.tgz#05dd754b6b052de7b150f9210e2160746961e3cf" fn-name@^2.0.0: version "2.0.1" From af5fdc2ebdbcad5106c746ef227dcffe59fd3b2a Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 22 Mar 2017 00:08:04 -0400 Subject: [PATCH 059/105] 7.0.0-beta.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 816c2c4d59..85a741cb33 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "7.0.0-beta.5", + "version": "7.0.0-beta.6", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 32eabf620b9d5eaf190969cc4a38f7775626a3f3 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Wed, 22 Mar 2017 10:25:10 +0100 Subject: [PATCH 060/105] Fix push-pop logic in flow (#405) --- src/plugins/flow.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 163918cdd4..9592064400 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -1377,10 +1377,10 @@ export default function (instance) { } } - // Need to push something onto the context to stop - // the JSX plugin from messing with the tokens - this.state.context.push(ct.parenExpression); if (jsxError != null || this.isRelational("<")) { + // Need to push something onto the context to stop + // the JSX plugin from messing with the tokens + this.state.context.push(ct.parenExpression); let arrowExpression; let typeParameters; try { @@ -1390,9 +1390,13 @@ export default function (instance) { arrowExpression.typeParameters = typeParameters; this.resetStartLocationFromNode(arrowExpression, typeParameters); } catch (err) { + this.state.context.pop(); + throw jsxError || err; } + this.state.context.pop(); + if (arrowExpression.type === "ArrowFunctionExpression") { return arrowExpression; } else if (jsxError != null) { @@ -1404,7 +1408,6 @@ export default function (instance) { ); } } - this.state.context.pop(); return inner.apply(this, args); }; From 9f7d9080cfdb6eec32de4187c713de66f5f40cab Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 22 Mar 2017 14:05:56 -0400 Subject: [PATCH 061/105] remove babylon plugin for template revision since it's stage-4 (#426) --- README.md | 2 +- src/parser/expression.js | 2 +- .../template-literal-invalid-escapes-tagged/options.json | 4 +--- .../1/options.json | 7 ++----- .../10/options.json | 7 ++----- .../11/options.json | 7 ++----- .../12/options.json | 7 ++----- .../13/options.json | 7 ++----- .../14/options.json | 7 ++----- .../15/options.json | 7 ++----- .../16/options.json | 7 ++----- .../17/options.json | 7 ++----- .../18/options.json | 7 ++----- .../19/options.json | 7 ++----- .../2/options.json | 7 ++----- .../20/options.json | 7 ++----- .../21/options.json | 7 ++----- .../22/options.json | 7 ++----- .../23/options.json | 7 ++----- .../24/options.json | 7 ++----- .../25/options.json | 7 ++----- .../26/options.json | 7 ++----- .../27/options.json | 7 ++----- .../28/options.json | 7 ++----- .../29/options.json | 7 ++----- .../3/options.json | 7 ++----- .../30/options.json | 7 ++----- .../31/options.json | 7 ++----- .../32/options.json | 7 ++----- .../33/options.json | 7 ++----- .../34/options.json | 7 ++----- .../35/options.json | 7 ++----- .../36/options.json | 7 ++----- .../37/options.json | 7 ++----- .../38/options.json | 7 ++----- .../39/options.json | 7 ++----- .../4/options.json | 7 ++----- .../40/options.json | 7 ++----- .../41/options.json | 7 ++----- .../42/options.json | 7 ++----- .../43/options.json | 7 ++----- .../44/options.json | 7 ++----- .../45/options.json | 7 ++----- .../46/options.json | 7 ++----- .../47/options.json | 7 ++----- .../48/options.json | 7 ++----- .../49/options.json | 7 ++----- .../5/options.json | 7 ++----- .../50/options.json | 7 ++----- .../51/options.json | 7 ++----- .../52/options.json | 7 ++----- .../53/options.json | 7 ++----- .../54/options.json | 7 ++----- .../55/options.json | 7 ++----- .../56/options.json | 7 ++----- .../57/options.json | 7 ++----- .../58/options.json | 7 ++----- .../59/options.json | 7 ++----- .../6/options.json | 7 ++----- .../60/options.json | 7 ++----- .../61/options.json | 7 ++----- .../62/options.json | 7 ++----- .../63/options.json | 7 ++----- .../64/options.json | 7 ++----- .../65/options.json | 7 ++----- .../66/options.json | 7 ++----- .../67/options.json | 7 ++----- .../68/options.json | 7 ++----- .../7/options.json | 7 ++----- .../8/options.json | 7 ++----- .../9/options.json | 7 ++----- 71 files changed, 139 insertions(+), 345 deletions(-) diff --git a/README.md b/README.md index 39188bb475..3aaf8acf43 100644 --- a/README.md +++ b/README.md @@ -134,4 +134,4 @@ require("babylon").parse("code", { - `functionBind` - `functionSent` - `dynamicImport` - - `templateInvalidEscapes` + diff --git a/src/parser/expression.js b/src/parser/expression.js index 5c9ebd588f..aeb6464f8d 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -688,7 +688,7 @@ pp.parseNew = function () { pp.parseTemplateElement = function (isTagged) { const elem = this.startNode(); if (this.state.value === null) { - if (!isTagged || !this.hasPlugin("templateInvalidEscapes")) { + if (!isTagged) { this.raise(this.state.invalidTemplateEscapePosition, "Invalid escape sequence in template"); } else { this.state.invalidTemplateEscapePosition = null; diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json index eb93fe5b94..0967ef424b 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json @@ -1,3 +1 @@ -{ - "plugins": ["templateInvalidEscapes"] -} +{} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json index 06ac8464d7..27524e2b1f 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:10)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:10)" +} diff --git a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json index 1cd5cd7bc8..fd4da953a4 100644 --- a/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json @@ -1,6 +1,3 @@ { - "throws": "Invalid escape sequence in template (1:2)", - "plugins": [ - "templateInvalidEscapes" - ] -} \ No newline at end of file + "throws": "Invalid escape sequence in template (1:2)" +} From e4e1cb0bda79dfafa4f35880961d5eadace24f08 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 22 Mar 2017 14:07:10 -0400 Subject: [PATCH 062/105] 7.0.0-beta.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 85a741cb33..b856a02c0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "7.0.0-beta.6", + "version": "7.0.0-beta.7", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From a495d7f65d69c0bfb30bdc1e4ef1fe30131df1b1 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Thu, 23 Mar 2017 16:10:07 -0500 Subject: [PATCH 063/105] Allow statics in flow interfaces (#427) --- src/plugins/flow.js | 8 +- .../interfaces-module-and-script/10/actual.js | 5 + .../10/expected.json | 239 ++++++++++++++++++ 3 files changed, 248 insertions(+), 4 deletions(-) create mode 100644 test/fixtures/flow/interfaces-module-and-script/10/actual.js create mode 100644 test/fixtures/flow/interfaces-module-and-script/10/expected.json diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 9592064400..fed1934731 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -69,7 +69,7 @@ pp.flowParseTypeAndPredicateInitialiser = function () { pp.flowParseDeclareClass = function (node) { this.next(); - this.flowParseInterfaceish(node, true); + this.flowParseInterfaceish(node); return this.finishNode(node, "DeclareClass"); }; @@ -194,7 +194,7 @@ pp.flowParseDeclareInterface = function (node) { // Interfaces -pp.flowParseInterfaceish = function (node, allowStatic) { +pp.flowParseInterfaceish = function (node) { node.id = this.parseIdentifier(); if (this.isRelational("<")) { @@ -219,7 +219,7 @@ pp.flowParseInterfaceish = function (node, allowStatic) { } while (this.eat(tt.comma)); } - node.body = this.flowParseObjectType(allowStatic); + node.body = this.flowParseObjectType(true); }; pp.flowParseInterfaceExtends = function () { @@ -236,7 +236,7 @@ pp.flowParseInterfaceExtends = function () { }; pp.flowParseInterface = function (node) { - this.flowParseInterfaceish(node, false); + this.flowParseInterfaceish(node); return this.finishNode(node, "InterfaceDeclaration"); }; diff --git a/test/fixtures/flow/interfaces-module-and-script/10/actual.js b/test/fixtures/flow/interfaces-module-and-script/10/actual.js new file mode 100644 index 0000000000..c12feec022 --- /dev/null +++ b/test/fixtures/flow/interfaces-module-and-script/10/actual.js @@ -0,0 +1,5 @@ +interface IFoo { + x: boolean; + static (): void; + static y: boolean; +} diff --git a/test/fixtures/flow/interfaces-module-and-script/10/expected.json b/test/fixtures/flow/interfaces-module-and-script/10/expected.json new file mode 100644 index 0000000000..ea68f99b99 --- /dev/null +++ b/test/fixtures/flow/interfaces-module-and-script/10/expected.json @@ -0,0 +1,239 @@ +{ + "type": "File", + "start": 0, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "module", + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "IFoo" + }, + "name": "IFoo" + }, + "typeParameters": null, + "extends": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 15, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "callProperties": [ + { + "type": "ObjectTypeCallProperty", + "start": 33, + "end": 49, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "static": true, + "value": { + "type": "FunctionTypeAnnotation", + "start": 40, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 44, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 17 + } + } + } + } + } + ], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 19, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "key": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "BooleanTypeAnnotation", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 12 + } + } + }, + "optional": false, + "static": false, + "variance": null + }, + { + "type": "ObjectTypeProperty", + "start": 52, + "end": 70, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 20 + } + }, + "key": { + "type": "Identifier", + "start": 59, + "end": 60, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + }, + "identifierName": "y" + }, + "name": "y" + }, + "value": { + "type": "BooleanTypeAnnotation", + "start": 62, + "end": 69, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 19 + } + } + }, + "optional": false, + "static": true, + "variance": null + } + ], + "indexers": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file From 2f3123ca034b934e33d2c1f01682b3184a85ec70 Mon Sep 17 00:00:00 2001 From: Alex Kuzmenko Date: Fri, 24 Mar 2017 11:57:36 +0200 Subject: [PATCH 064/105] Fix CONTRIBUTING.md [skip ci] (#432) --- CONTRIBUTING.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c065958bdf..0184164cdc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,16 +23,16 @@ yarn To run a build, tests and perform lint/flow checks: ```bash -npm test +yarn test ``` If you only want to run the tests: ```bash -npm run test-only +yarn run test-only ``` -Note, this does not actually run a build, so you may have to call `npm run build` after +Note, this does not actually run a build, so you may have to call `yarn run build` after performing any changes. ### Running one test @@ -52,7 +52,7 @@ Add `"only": true` to its `options.json`: Then, run the tests using the same command as before: ```bash -npm run test-only +yarn run test-only ``` ### Checking code coverage locally @@ -61,7 +61,7 @@ To generate code coverage, be sure to set `BABEL_ENV=test` so that code is instr the rollup build. ```bash -BABEL_ENV=test npm run build && npm run test-ci +BABEL_ENV=test yarn run build && yarn run test-coverage ``` ### Writing tests @@ -85,19 +85,19 @@ you will want to link both repositories together. This can be done by doing the ```bash cd babylon/ -npm link -npm run build +yarn link +yarn run build cd ../babel/ make bootstrap -npm link babylon +yarn link babylon cd packages/babel-core/ -npm link babylon +yarn link babylon cd ../../packages/babel-template/ -npm link babylon +yarn link babylon cd ../../packages/babel-traverse/ -npm link babylon +yarn link babylon cd ../../packages/babel-generator/ -npm link babylon +yarn link babylon cd ../.. make build make test From 4d1822109887f6430c1d17b806fc49f97a1cde65 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Thu, 30 Mar 2017 10:25:23 -0500 Subject: [PATCH 065/105] Use babel-register script when running babel smoke tests (#442) --- Makefile | 2 +- package.json | 12 +- scripts/test-babel-register.js | 10 + yarn.lock | 802 +++++++++++++++++++++------------ 4 files changed, 538 insertions(+), 288 deletions(-) create mode 100644 scripts/test-babel-register.js diff --git a/Makefile b/Makefile index 82a89ee84b..c3ea88785d 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ test-babel: cd ./build/babel; \ jq "del(.nyc)" package.json > package.nonyc.json; \ mv -f package.nonyc.json package.json; \ - ../../node_modules/.bin/nyc --no-instrument --no-source-map --reporter=json --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts; \ + ../../node_modules/.bin/nyc --no-instrument --no-source-map --reporter=json --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts --compilers js:../../scripts/test-babel-register.js; \ bootstrap-flow: clean mkdir ./build diff --git a/package.json b/package.json index b856a02c0d..46f25f21f1 100644 --- a/package.json +++ b/package.json @@ -22,14 +22,14 @@ }, "devDependencies": { "ava": "^0.18.0", - "babel-cli": "^6.14.0", + "babel-cli": "^7.0.0-alpha.6", "babel-eslint": "^7.0.0", - "babel-helper-fixtures": "^6.9.0", - "babel-plugin-external-helpers": "^6.18.0", + "babel-helper-fixtures": "^7.0.0-alpha.3", + "babel-plugin-external-helpers": "^7.0.0-alpha.3", "babel-plugin-istanbul": "^4.0.0", - "babel-plugin-transform-flow-strip-types": "^6.14.0", - "babel-preset-es2015": "^6.14.0", - "babel-preset-stage-0": "^6.5.0", + "babel-plugin-transform-flow-strip-types": "^7.0.0-alpha.3", + "babel-preset-es2015": "^7.0.0-alpha.3", + "babel-preset-stage-0": "^7.0.0-alpha.3", "chalk": "^1.1.3", "cross-env": "^3.1.4", "eslint": "^3.7.1", diff --git a/scripts/test-babel-register.js b/scripts/test-babel-register.js new file mode 100644 index 0000000000..d70a3ff7ff --- /dev/null +++ b/scripts/test-babel-register.js @@ -0,0 +1,10 @@ +"use strict"; + +const register = require("babel-register").default; + +register({ + extensions: [".js"], + // Only js files in the test folder but not in the subfolder fixtures. + only: [/packages\/.+\/test\/(?!fixtures\/).+\.js$/], + compact: true, +}); diff --git a/yarn.lock b/yarn.lock index 50d3c2e0c1..f1c57a9407 100644 --- a/yarn.lock +++ b/yarn.lock @@ -295,27 +295,33 @@ aws4@^1.2.1: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" -babel-cli@^6.14.0: - version "6.24.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.24.0.tgz#a05ffd210dca0c288a26d5319c5ac8669a265ad0" +babel-cli@^7.0.0-alpha.6: + version "7.0.0-alpha.6" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-7.0.0-alpha.6.tgz#80c2888379dc91bbb8171512bfa58ebe96819b4d" dependencies: - babel-core "^6.24.0" - babel-polyfill "^6.23.0" - babel-register "^6.24.0" - babel-runtime "^6.22.0" + babel-core "7.0.0-alpha.6" + babel-polyfill "7.0.0-alpha.3" + babel-register "7.0.0-alpha.6" commander "^2.8.1" convert-source-map "^1.1.0" fs-readdir-recursive "^1.0.0" glob "^7.0.0" lodash "^4.2.0" output-file-sync "^1.1.0" - path-is-absolute "^1.0.0" slash "^1.0.0" source-map "^0.5.0" v8flags "^2.0.10" optionalDependencies: chokidar "^1.6.1" +babel-code-frame@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.3.tgz#9ff265eaaac94b58dfc7ca4a4eecf389d5f4d344" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" @@ -348,6 +354,28 @@ babel-core@6, babel-core@^6.17.0, babel-core@^6.24.0: slash "^1.0.0" source-map "^0.5.0" +babel-core@7.0.0-alpha.6: + version "7.0.0-alpha.6" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-alpha.6.tgz#a4c59f5cd5ef0374365a37937e5c585510eed718" + dependencies: + babel-code-frame "7.0.0-alpha.3" + babel-generator "7.0.0-alpha.3" + babel-helpers "7.0.0-alpha.3" + babel-messages "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" + babel-traverse "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + babylon "7.0.0-beta.7" + convert-source-map "^1.1.0" + debug "^2.1.1" + json5 "^0.5.0" + lodash "^4.2.0" + micromatch "^2.3.11" + private "^0.1.6" + resolve "^1.3.2" + slash "^1.0.0" + source-map "^0.5.0" + babel-eslint@^7.0.0: version "7.1.1" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.1.1.tgz#8a6a884f085aa7060af69cfc77341c2f99370fb2" @@ -358,6 +386,18 @@ babel-eslint@^7.0.0: babylon "^6.13.0" lodash.pickby "^4.6.0" +babel-generator@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-7.0.0-alpha.3.tgz#92af29b9e75fbe6888ef0d28b39e34f9ec83a06c" + dependencies: + babel-messages "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + babel-generator@^6.1.0, babel-generator@^6.18.0, babel-generator@^6.24.0: version "6.24.0" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.0.tgz#eba270a8cc4ce6e09a61be43465d7c62c1f87c56" @@ -371,14 +411,6 @@ babel-generator@^6.1.0, babel-generator@^6.18.0, babel-generator@^6.24.0: source-map "^0.5.0" trim-right "^1.0.1" -babel-helper-bindify-decorators@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.22.0.tgz#d7f5bc261275941ac62acfc4e20dacfb8a3fe952" - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" - babel-helper-builder-binary-assignment-operator-visitor@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.22.0.tgz#29df56be144d81bdeac08262bfa41d2c5e91cdcd" @@ -387,6 +419,14 @@ babel-helper-builder-binary-assignment-operator-visitor@^6.22.0: babel-runtime "^6.22.0" babel-types "^6.22.0" +babel-helper-call-delegate@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-7.0.0-alpha.3.tgz#23c12acd22ade7ed05b27a51ad2c7d1016929dbf" + dependencies: + babel-helper-hoist-variables "7.0.0-alpha.3" + babel-traverse "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + babel-helper-call-delegate@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz#119921b56120f17e9dae3f74b4f5cc7bcc1b37ef" @@ -396,6 +436,14 @@ babel-helper-call-delegate@^6.22.0: babel-traverse "^6.22.0" babel-types "^6.22.0" +babel-helper-define-map@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-7.0.0-alpha.3.tgz#1d67803d202440e70ed10ddff74600e143be50fa" + dependencies: + babel-helper-function-name "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + lodash "^4.2.0" + babel-helper-define-map@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz#1444f960c9691d69a2ced6a205315f8fd00804e7" @@ -413,23 +461,22 @@ babel-helper-explode-assignable-expression@^6.22.0: babel-traverse "^6.22.0" babel-types "^6.22.0" -babel-helper-explode-class@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.22.0.tgz#646304924aa6388a516843ba7f1855ef8dfeb69b" +babel-helper-fixtures@^7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helper-fixtures/-/babel-helper-fixtures-7.0.0-alpha.3.tgz#7095057fe51432cc0300c7de0f84cba9e8057ecc" dependencies: - babel-helper-bindify-decorators "^6.22.0" - babel-runtime "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" - -babel-helper-fixtures@^6.9.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-fixtures/-/babel-helper-fixtures-6.22.0.tgz#3cb9eaf5feae29f001d2754ab43b14a9dfa304ff" - dependencies: - babel-runtime "^6.22.0" lodash "^4.2.0" try-resolve "^1.0.0" +babel-helper-function-name@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-alpha.3.tgz#c20acaadfff6632b7c7efccab31d60d5e8e59814" + dependencies: + babel-helper-get-function-arity "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" + babel-traverse "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + babel-helper-function-name@^6.22.0, babel-helper-function-name@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz#25742d67175c8903dbe4b6cb9d9e1fcb8dcf23a6" @@ -440,6 +487,12 @@ babel-helper-function-name@^6.22.0, babel-helper-function-name@^6.23.0: babel-traverse "^6.23.0" babel-types "^6.23.0" +babel-helper-get-function-arity@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-alpha.3.tgz#e2c2db48d65300da135cabd91d8e9629b07ca5e8" + dependencies: + babel-types "7.0.0-alpha.3" + babel-helper-get-function-arity@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz#0beb464ad69dc7347410ac6ade9f03a50634f5ce" @@ -447,6 +500,12 @@ babel-helper-get-function-arity@^6.22.0: babel-runtime "^6.22.0" babel-types "^6.22.0" +babel-helper-hoist-variables@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-7.0.0-alpha.3.tgz#6bd71cdea55d848877acf14c3751b8598c0fd198" + dependencies: + babel-types "7.0.0-alpha.3" + babel-helper-hoist-variables@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz#3eacbf731d80705845dd2e9718f600cfb9b4ba72" @@ -454,6 +513,12 @@ babel-helper-hoist-variables@^6.22.0: babel-runtime "^6.22.0" babel-types "^6.22.0" +babel-helper-optimise-call-expression@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-7.0.0-alpha.3.tgz#a3c5ba4a5e59c651c74f9e17351ff8d4093f13b2" + dependencies: + babel-types "7.0.0-alpha.3" + babel-helper-optimise-call-expression@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz#f3ee7eed355b4282138b33d02b78369e470622f5" @@ -461,7 +526,14 @@ babel-helper-optimise-call-expression@^6.23.0: babel-runtime "^6.22.0" babel-types "^6.23.0" -babel-helper-regex@^6.22.0: +babel-helper-regex@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-7.0.0-alpha.3.tgz#c74440fc1418b6e92290c4880e15e3738f31a366" + dependencies: + babel-types "7.0.0-alpha.3" + lodash "^4.2.0" + +babel-helper-regex@^6.18.0, babel-helper-regex@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz#79f532be1647b1f0ee3474b5f5c3da58001d247d" dependencies: @@ -469,6 +541,15 @@ babel-helper-regex@^6.22.0: babel-types "^6.22.0" lodash "^4.2.0" +babel-helper-remap-async-to-generator@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-7.0.0-alpha.3.tgz#9b137a1222a186f1cfb6fa292af5d302085e1aa7" + dependencies: + babel-helper-function-name "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" + babel-traverse "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + babel-helper-remap-async-to-generator@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.22.0.tgz#2186ae73278ed03b8b15ced089609da981053383" @@ -479,7 +560,17 @@ babel-helper-remap-async-to-generator@^6.22.0: babel-traverse "^6.22.0" babel-types "^6.22.0" -babel-helper-replace-supers@^6.22.0, babel-helper-replace-supers@^6.23.0: +babel-helper-replace-supers@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-7.0.0-alpha.3.tgz#04c701909509867fa84bceeb2b0e51b34cf2d657" + dependencies: + babel-helper-optimise-call-expression "7.0.0-alpha.3" + babel-messages "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" + babel-traverse "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + +babel-helper-replace-supers@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz#eeaf8ad9b58ec4337ca94223bacdca1f8d9b4bfd" dependencies: @@ -490,6 +581,12 @@ babel-helper-replace-supers@^6.22.0, babel-helper-replace-supers@^6.23.0: babel-traverse "^6.23.0" babel-types "^6.23.0" +babel-helpers@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-7.0.0-alpha.3.tgz#e9a5362d84bfa6730dca16f762e185a077afc45e" + dependencies: + babel-template "7.0.0-alpha.3" + babel-helpers@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.23.0.tgz#4f8f2e092d0b6a8808a4bde79c27f1e2ecf0d992" @@ -497,6 +594,10 @@ babel-helpers@^6.23.0: babel-runtime "^6.22.0" babel-template "^6.23.0" +babel-messages@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.3.tgz#c8390a468478b8384da134612e12a6bc31a684e9" + babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" @@ -510,7 +611,11 @@ babel-plugin-ava-throws-helper@^1.0.0: babel-template "^6.7.0" babel-types "^6.7.2" -babel-plugin-check-es2015-constants@^6.22.0, babel-plugin-check-es2015-constants@^6.8.0: +babel-plugin-check-es2015-constants@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-7.0.0-alpha.3.tgz#bc83e61842bf8769515e7f69cb43cf7f2546aaba" + +babel-plugin-check-es2015-constants@^6.8.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" dependencies: @@ -528,11 +633,9 @@ babel-plugin-espower@^2.3.2: espurify "^1.6.0" estraverse "^4.1.1" -babel-plugin-external-helpers@^6.18.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" - dependencies: - babel-runtime "^6.22.0" +babel-plugin-external-helpers@^7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-7.0.0-alpha.3.tgz#0fd8b75ae487025f1ad61616aaeb3850d1c9ad63" babel-plugin-istanbul@^4.0.0: version "4.0.0" @@ -546,63 +649,58 @@ babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" -babel-plugin-syntax-async-generators@^6.5.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" - -babel-plugin-syntax-class-constructor-call@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz#9cb9d39fe43c8600bec8146456ddcbd4e1a76416" +babel-plugin-syntax-async-generators@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-7.0.0-alpha.3.tgz#2b248b8d1d12c26728571f004b0b633f8c192a7f" -babel-plugin-syntax-class-properties@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" +babel-plugin-syntax-class-properties@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-7.0.0-alpha.3.tgz#d1324dc38545f8365f51bd174bdc03fc1a1f6d8e" -babel-plugin-syntax-decorators@^6.13.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" +babel-plugin-syntax-decorators@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-7.0.0-alpha.3.tgz#b7a3c443df608966599e771b4a94a31a7cda3d4f" -babel-plugin-syntax-do-expressions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz#5747756139aa26d390d09410b03744ba07e4796d" +babel-plugin-syntax-do-expressions@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-7.0.0-alpha.3.tgz#f012a7640b3581a2e3fd4b0ccb95598248355237" -babel-plugin-syntax-dynamic-import@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" +babel-plugin-syntax-dynamic-import@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-7.0.0-alpha.3.tgz#c181227705398ea333071ca7ff59196d8ba6d953" babel-plugin-syntax-exponentiation-operator@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" -babel-plugin-syntax-export-extensions@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721" +babel-plugin-syntax-export-extensions@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-7.0.0-alpha.3.tgz#cf0caca528af0508ee34eb5d3cd9309bbe025f61" -babel-plugin-syntax-flow@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" +babel-plugin-syntax-flow@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-7.0.0-alpha.3.tgz#9776060b86674a5375a53eaabbd305ca4f5ab2fa" -babel-plugin-syntax-function-bind@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz#48c495f177bdf31a981e732f55adc0bdd2601f46" +babel-plugin-syntax-function-bind@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-7.0.0-alpha.3.tgz#7ed78e62b87b2f38d2cf02d90e9c8b5d77309f57" -babel-plugin-syntax-object-rest-spread@^6.8.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" +babel-plugin-syntax-object-rest-spread@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-7.0.0-alpha.3.tgz#52dd2698be335f1c0297d5d34ac526537ef63576" -babel-plugin-syntax-trailing-function-commas@^6.20.0, babel-plugin-syntax-trailing-function-commas@^6.22.0: +babel-plugin-syntax-trailing-function-commas@^6.20.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" -babel-plugin-transform-async-generator-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.22.0.tgz#a720a98153a7596f204099cd5409f4b3c05bab46" +babel-plugin-transform-async-generator-functions@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-7.0.0-alpha.3.tgz#ba61d374ca649e9cf48f5ddb70c893d87d3af31e" dependencies: - babel-helper-remap-async-to-generator "^6.22.0" - babel-plugin-syntax-async-generators "^6.5.0" - babel-runtime "^6.22.0" + babel-helper-remap-async-to-generator "7.0.0-alpha.3" + babel-plugin-syntax-async-generators "7.0.0-alpha.3" -babel-plugin-transform-async-to-generator@^6.16.0, babel-plugin-transform-async-to-generator@^6.22.0: +babel-plugin-transform-async-to-generator@^6.16.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.22.0.tgz#194b6938ec195ad36efc4c33a971acf00d8cd35e" dependencies: @@ -610,63 +708,59 @@ babel-plugin-transform-async-to-generator@^6.16.0, babel-plugin-transform-async- babel-plugin-syntax-async-functions "^6.8.0" babel-runtime "^6.22.0" -babel-plugin-transform-class-constructor-call@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.22.0.tgz#11a4d2216abb5b0eef298b493748f4f2f4869120" +babel-plugin-transform-class-properties@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-7.0.0-alpha.3.tgz#74b48911411c2e000a74c0c8a08bb8e36afb17df" dependencies: - babel-plugin-syntax-class-constructor-call "^6.18.0" - babel-runtime "^6.22.0" - babel-template "^6.22.0" + babel-helper-function-name "7.0.0-alpha.3" + babel-plugin-syntax-class-properties "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" -babel-plugin-transform-class-properties@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.23.0.tgz#187b747ee404399013563c993db038f34754ac3b" +babel-plugin-transform-decorators@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-7.0.0-alpha.3.tgz#a0d3586d399d59d8b43d14c8f5b87efe9f5d0ae2" dependencies: - babel-helper-function-name "^6.23.0" - babel-plugin-syntax-class-properties "^6.8.0" - babel-runtime "^6.22.0" - babel-template "^6.23.0" + babel-plugin-syntax-decorators "7.0.0-alpha.3" + babel-runtime "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" -babel-plugin-transform-decorators@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.22.0.tgz#c03635b27a23b23b7224f49232c237a73988d27c" +babel-plugin-transform-do-expressions@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-7.0.0-alpha.3.tgz#9a0442f5f8a6314d3c6e5f086ff6cade2fb3a382" dependencies: - babel-helper-explode-class "^6.22.0" - babel-plugin-syntax-decorators "^6.13.0" - babel-runtime "^6.22.0" - babel-template "^6.22.0" - babel-types "^6.22.0" + babel-plugin-syntax-do-expressions "7.0.0-alpha.3" -babel-plugin-transform-do-expressions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb" - dependencies: - babel-plugin-syntax-do-expressions "^6.8.0" - babel-runtime "^6.22.0" +babel-plugin-transform-es2015-arrow-functions@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-7.0.0-alpha.3.tgz#1c07e322a1d6d58173f69e0a48f7b7e89a1d64ef" -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - dependencies: - babel-runtime "^6.22.0" +babel-plugin-transform-es2015-block-scoped-functions@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-7.0.0-alpha.3.tgz#fa5f3f3715e05ec3a1ef2c1ec8bb1f1fe3a4ce0a" -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" +babel-plugin-transform-es2015-block-scoping@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-7.0.0-alpha.3.tgz#8c939676d0be68ef55500455b785ed1b4c0160bd" dependencies: - babel-runtime "^6.22.0" + babel-template "7.0.0-alpha.3" + babel-traverse "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + lodash "^4.2.0" -babel-plugin-transform-es2015-block-scoping@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz#e48895cf0b375be148cd7c8879b422707a053b51" +babel-plugin-transform-es2015-classes@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-7.0.0-alpha.3.tgz#98e6fc79f1d3ac9ed2c51ee7c3f14d8c38ffe2c6" dependencies: - babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" - lodash "^4.2.0" + babel-helper-define-map "7.0.0-alpha.3" + babel-helper-function-name "7.0.0-alpha.3" + babel-helper-optimise-call-expression "7.0.0-alpha.3" + babel-helper-replace-supers "7.0.0-alpha.3" + babel-messages "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" + babel-traverse "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" -babel-plugin-transform-es2015-classes@^6.22.0, babel-plugin-transform-es2015-classes@^6.9.0: +babel-plugin-transform-es2015-classes@^6.9.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz#49b53f326202a2fd1b3bbaa5e2edd8a4f78643c1" dependencies: @@ -680,33 +774,40 @@ babel-plugin-transform-es2015-classes@^6.22.0, babel-plugin-transform-es2015-cla babel-traverse "^6.23.0" babel-types "^6.23.0" -babel-plugin-transform-es2015-computed-properties@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz#7c383e9629bba4820c11b0425bdd6290f7f057e7" +babel-plugin-transform-es2015-computed-properties@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-7.0.0-alpha.3.tgz#9577e8d3a45e63da5c5ddf14163fb2ef67bb26c8" dependencies: - babel-runtime "^6.22.0" - babel-template "^6.22.0" + babel-template "7.0.0-alpha.3" -babel-plugin-transform-es2015-destructuring@^6.19.0, babel-plugin-transform-es2015-destructuring@^6.22.0: +babel-plugin-transform-es2015-destructuring@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-7.0.0-alpha.3.tgz#509333f153ba1b58fa1a4b48286cbdce11b028a0" + +babel-plugin-transform-es2015-destructuring@^6.19.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-duplicate-keys@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz#672397031c21610d72dd2bbb0ba9fb6277e1c36b" +babel-plugin-transform-es2015-duplicate-keys@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-7.0.0-alpha.3.tgz#1a4add3548ffd64f209be62695409d3d616b0d64" dependencies: - babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "7.0.0-alpha.3" -babel-plugin-transform-es2015-for-of@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" +babel-plugin-transform-es2015-for-of@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-7.0.0-alpha.3.tgz#6a959e8995a21ae796deaa2db7d74b7009a9dd79" + +babel-plugin-transform-es2015-function-name@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-7.0.0-alpha.3.tgz#39d08ce84f45d7652f20a2123b556a9de24459c2" dependencies: - babel-runtime "^6.22.0" + babel-helper-function-name "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" -babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.9.0: +babel-plugin-transform-es2015-function-name@^6.9.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz#f5fcc8b09093f9a23c76ac3d9e392c3ec4b77104" dependencies: @@ -714,21 +815,26 @@ babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es20 babel-runtime "^6.22.0" babel-types "^6.22.0" -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" +babel-plugin-transform-es2015-literals@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-7.0.0-alpha.3.tgz#748048faebe88da55cad28e9c1d50c83e1eb0de7" + +babel-plugin-transform-es2015-modules-amd@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-7.0.0-alpha.3.tgz#960aa59d67e76948beea0cd2a5bb6771cea36c7f" dependencies: - babel-runtime "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" -babel-plugin-transform-es2015-modules-amd@^6.24.0: - version "6.24.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.0.tgz#a1911fb9b7ec7e05a43a63c5995007557bcf6a2e" +babel-plugin-transform-es2015-modules-commonjs@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-7.0.0-alpha.3.tgz#9d5b06621da4f6f665345d4ecc86084f74f608ce" dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.0" - babel-runtime "^6.22.0" - babel-template "^6.22.0" + babel-plugin-transform-strict-mode "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" -babel-plugin-transform-es2015-modules-commonjs@^6.18.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.0: +babel-plugin-transform-es2015-modules-commonjs@^6.18.0: version "6.24.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.0.tgz#e921aefb72c2cc26cb03d107626156413222134f" dependencies: @@ -737,30 +843,37 @@ babel-plugin-transform-es2015-modules-commonjs@^6.18.0, babel-plugin-transform-e babel-template "^6.23.0" babel-types "^6.23.0" -babel-plugin-transform-es2015-modules-systemjs@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz#ae3469227ffac39b0310d90fec73bfdc4f6317b0" +babel-plugin-transform-es2015-modules-systemjs@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-7.0.0-alpha.3.tgz#b725ff684cf660001700fb9377b58940a6977b91" dependencies: - babel-helper-hoist-variables "^6.22.0" - babel-runtime "^6.22.0" - babel-template "^6.23.0" + babel-helper-hoist-variables "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" -babel-plugin-transform-es2015-modules-umd@^6.24.0: - version "6.24.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.0.tgz#fd5fa63521cae8d273927c3958afd7c067733450" +babel-plugin-transform-es2015-modules-umd@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-7.0.0-alpha.3.tgz#ec37fa367540262900b0b14cda7f2006bb1e1430" dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.0" - babel-runtime "^6.22.0" - babel-template "^6.23.0" + babel-plugin-transform-es2015-modules-amd "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" -babel-plugin-transform-es2015-object-super@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz#daa60e114a042ea769dd53fe528fc82311eb98fc" +babel-plugin-transform-es2015-object-super@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-7.0.0-alpha.3.tgz#b27368c505aa951656cc96749b485401da620429" dependencies: - babel-helper-replace-supers "^6.22.0" - babel-runtime "^6.22.0" + babel-helper-replace-supers "7.0.0-alpha.3" + +babel-plugin-transform-es2015-parameters@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-7.0.0-alpha.3.tgz#909e780d1e5bf9d972f80f389de95d45c36d40e6" + dependencies: + babel-helper-call-delegate "7.0.0-alpha.3" + babel-helper-get-function-arity "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" + babel-traverse "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" -babel-plugin-transform-es2015-parameters@^6.21.0, babel-plugin-transform-es2015-parameters@^6.22.0: +babel-plugin-transform-es2015-parameters@^6.21.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz#3a2aabb70c8af945d5ce386f1a4250625a83ae3b" dependencies: @@ -771,20 +884,30 @@ babel-plugin-transform-es2015-parameters@^6.21.0, babel-plugin-transform-es2015- babel-traverse "^6.23.0" babel-types "^6.23.0" -babel-plugin-transform-es2015-shorthand-properties@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz#8ba776e0affaa60bff21e921403b8a652a2ff723" +babel-plugin-transform-es2015-shorthand-properties@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-7.0.0-alpha.3.tgz#6c704d77495994c91f17f2e8e39d89fa6f3d978c" dependencies: - babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "7.0.0-alpha.3" + +babel-plugin-transform-es2015-spread@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-7.0.0-alpha.3.tgz#2d4b831e6b0e7c73e8201c38a824fe88d6168567" -babel-plugin-transform-es2015-spread@^6.22.0, babel-plugin-transform-es2015-spread@^6.8.0: +babel-plugin-transform-es2015-spread@^6.8.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.8.0: +babel-plugin-transform-es2015-sticky-regex@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-7.0.0-alpha.3.tgz#abc021c8ad9a9ced19c27b0d94d1817abf2a8a2b" + dependencies: + babel-helper-regex "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + +babel-plugin-transform-es2015-sticky-regex@^6.8.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz#ab316829e866ee3f4b9eb96939757d19a5bc4593" dependencies: @@ -792,19 +915,22 @@ babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es201 babel-runtime "^6.22.0" babel-types "^6.22.0" -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - dependencies: - babel-runtime "^6.22.0" +babel-plugin-transform-es2015-template-literals@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-7.0.0-alpha.3.tgz#ccad4e75903dc5ee1989a5108b83740c80b3629a" -babel-plugin-transform-es2015-typeof-symbol@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" +babel-plugin-transform-es2015-typeof-symbol@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-7.0.0-alpha.3.tgz#6592d301f2c40e5e943e5a3e26e56adc6db736ac" + +babel-plugin-transform-es2015-unicode-regex@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-7.0.0-alpha.3.tgz#0c8acf70e05dcfceaf9c3bfa10f123a645c44bac" dependencies: - babel-runtime "^6.22.0" + babel-helper-regex "7.0.0-alpha.3" + regexpu-core "^4.0.2" -babel-plugin-transform-es2015-unicode-regex@^6.11.0, babel-plugin-transform-es2015-unicode-regex@^6.22.0: +babel-plugin-transform-es2015-unicode-regex@^6.11.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz#8d9cc27e7ee1decfe65454fb986452a04a613d20" dependencies: @@ -812,7 +938,7 @@ babel-plugin-transform-es2015-unicode-regex@^6.11.0, babel-plugin-transform-es20 babel-runtime "^6.22.0" regexpu-core "^2.0.0" -babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.8.0: +babel-plugin-transform-exponentiation-operator@^6.8.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.22.0.tgz#d57c8335281918e54ef053118ce6eb108468084d" dependencies: @@ -820,39 +946,41 @@ babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-e babel-plugin-syntax-exponentiation-operator "^6.8.0" babel-runtime "^6.22.0" -babel-plugin-transform-export-extensions@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653" +babel-plugin-transform-export-extensions@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-7.0.0-alpha.3.tgz#c5b9e386db077eb6f63f0d6cabeccbc399245d6d" dependencies: - babel-plugin-syntax-export-extensions "^6.8.0" - babel-runtime "^6.22.0" + babel-plugin-syntax-export-extensions "7.0.0-alpha.3" -babel-plugin-transform-flow-strip-types@^6.14.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" +babel-plugin-transform-flow-strip-types@^7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-7.0.0-alpha.3.tgz#35681202b913f5b1a73d29a3f555dffff8ecad64" dependencies: - babel-plugin-syntax-flow "^6.18.0" - babel-runtime "^6.22.0" + babel-plugin-syntax-flow "7.0.0-alpha.3" -babel-plugin-transform-function-bind@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz#c6fb8e96ac296a310b8cf8ea401462407ddf6a97" +babel-plugin-transform-function-bind@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-7.0.0-alpha.3.tgz#1f10da630b4aeb2dc88ed368cd13cd54c70e7cec" dependencies: - babel-plugin-syntax-function-bind "^6.8.0" - babel-runtime "^6.22.0" + babel-plugin-syntax-function-bind "7.0.0-alpha.3" -babel-plugin-transform-object-rest-spread@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" +babel-plugin-transform-object-rest-spread@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-7.0.0-alpha.3.tgz#111a7e158ee02adf212933d9ad829f3d63eff207" dependencies: - babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.22.0" + babel-plugin-syntax-object-rest-spread "7.0.0-alpha.3" -babel-plugin-transform-regenerator@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz#65740593a319c44522157538d690b84094617ea6" +babel-plugin-transform-regenerator@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-7.0.0-alpha.3.tgz#5d76d87e8e1a0b73bf77aaefd704cdb535182a4e" dependencies: - regenerator-transform "0.9.8" + regenerator-transform "0.9.11" + +babel-plugin-transform-strict-mode@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-7.0.0-alpha.3.tgz#308068db94074f368eac190a854ebaf43118e03f" + dependencies: + babel-types "7.0.0-alpha.3" babel-plugin-transform-strict-mode@^6.22.0: version "6.22.0" @@ -861,77 +989,92 @@ babel-plugin-transform-strict-mode@^6.22.0: babel-runtime "^6.22.0" babel-types "^6.22.0" -babel-polyfill@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" - dependencies: - babel-runtime "^6.22.0" - core-js "^2.4.0" - regenerator-runtime "^0.10.0" - -babel-preset-es2015@^6.14.0: - version "6.24.0" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.0.tgz#c162d68b1932696e036cd3110dc1ccd303d2673a" - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.22.0" - babel-plugin-transform-es2015-classes "^6.22.0" - babel-plugin-transform-es2015-computed-properties "^6.22.0" - babel-plugin-transform-es2015-destructuring "^6.22.0" - babel-plugin-transform-es2015-duplicate-keys "^6.22.0" - babel-plugin-transform-es2015-for-of "^6.22.0" - babel-plugin-transform-es2015-function-name "^6.22.0" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.24.0" - babel-plugin-transform-es2015-modules-commonjs "^6.24.0" - babel-plugin-transform-es2015-modules-systemjs "^6.22.0" - babel-plugin-transform-es2015-modules-umd "^6.24.0" - babel-plugin-transform-es2015-object-super "^6.22.0" - babel-plugin-transform-es2015-parameters "^6.22.0" - babel-plugin-transform-es2015-shorthand-properties "^6.22.0" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.22.0" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.22.0" - babel-plugin-transform-es2015-unicode-regex "^6.22.0" - babel-plugin-transform-regenerator "^6.22.0" - -babel-preset-stage-0@^6.5.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.22.0.tgz#707eeb5b415da769eff9c42f4547f644f9296ef9" - dependencies: - babel-plugin-transform-do-expressions "^6.22.0" - babel-plugin-transform-function-bind "^6.22.0" - babel-preset-stage-1 "^6.22.0" - -babel-preset-stage-1@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.22.0.tgz#7da05bffea6ad5a10aef93e320cfc6dd465dbc1a" +babel-plugin-transform-unicode-property-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-unicode-property-regex/-/babel-plugin-transform-unicode-property-regex-2.0.1.tgz#fd8f2622d372edc6873cb646a0e1e2f15430d965" dependencies: - babel-plugin-transform-class-constructor-call "^6.22.0" - babel-plugin-transform-export-extensions "^6.22.0" - babel-preset-stage-2 "^6.22.0" + babel-helper-regex "^6.18.0" + babel-runtime "^6.23.0" + regexpu-core "^4.0.4" -babel-preset-stage-2@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.22.0.tgz#ccd565f19c245cade394b21216df704a73b27c07" +babel-polyfill@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-7.0.0-alpha.3.tgz#2f0f39b7a537fcdb03f506add010a71013a07bd3" dependencies: - babel-plugin-syntax-dynamic-import "^6.18.0" - babel-plugin-transform-class-properties "^6.22.0" - babel-plugin-transform-decorators "^6.22.0" - babel-preset-stage-3 "^6.22.0" + core-js "^2.4.0" + regenerator-runtime "^0.10.0" -babel-preset-stage-3@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.22.0.tgz#a4e92bbace7456fafdf651d7a7657ee0bbca9c2e" - dependencies: - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-generator-functions "^6.22.0" - babel-plugin-transform-async-to-generator "^6.22.0" - babel-plugin-transform-exponentiation-operator "^6.22.0" - babel-plugin-transform-object-rest-spread "^6.22.0" +babel-preset-es2015@^7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-7.0.0-alpha.3.tgz#16534cf8dbc86369dbf5d6bb08c9d43101b81628" + dependencies: + babel-plugin-check-es2015-constants "7.0.0-alpha.3" + babel-plugin-transform-es2015-arrow-functions "7.0.0-alpha.3" + babel-plugin-transform-es2015-block-scoped-functions "7.0.0-alpha.3" + babel-plugin-transform-es2015-block-scoping "7.0.0-alpha.3" + babel-plugin-transform-es2015-classes "7.0.0-alpha.3" + babel-plugin-transform-es2015-computed-properties "7.0.0-alpha.3" + babel-plugin-transform-es2015-destructuring "7.0.0-alpha.3" + babel-plugin-transform-es2015-duplicate-keys "7.0.0-alpha.3" + babel-plugin-transform-es2015-for-of "7.0.0-alpha.3" + babel-plugin-transform-es2015-function-name "7.0.0-alpha.3" + babel-plugin-transform-es2015-literals "7.0.0-alpha.3" + babel-plugin-transform-es2015-modules-amd "7.0.0-alpha.3" + babel-plugin-transform-es2015-modules-commonjs "7.0.0-alpha.3" + babel-plugin-transform-es2015-modules-systemjs "7.0.0-alpha.3" + babel-plugin-transform-es2015-modules-umd "7.0.0-alpha.3" + babel-plugin-transform-es2015-object-super "7.0.0-alpha.3" + babel-plugin-transform-es2015-parameters "7.0.0-alpha.3" + babel-plugin-transform-es2015-shorthand-properties "7.0.0-alpha.3" + babel-plugin-transform-es2015-spread "7.0.0-alpha.3" + babel-plugin-transform-es2015-sticky-regex "7.0.0-alpha.3" + babel-plugin-transform-es2015-template-literals "7.0.0-alpha.3" + babel-plugin-transform-es2015-typeof-symbol "7.0.0-alpha.3" + babel-plugin-transform-es2015-unicode-regex "7.0.0-alpha.3" + babel-plugin-transform-regenerator "7.0.0-alpha.3" + +babel-preset-stage-0@^7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-7.0.0-alpha.3.tgz#f2db6c2ec82975ca99b77c867d95d821d61e3731" + dependencies: + babel-plugin-transform-do-expressions "7.0.0-alpha.3" + babel-plugin-transform-function-bind "7.0.0-alpha.3" + babel-preset-stage-1 "7.0.0-alpha.3" + +babel-preset-stage-1@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-7.0.0-alpha.3.tgz#2de86602a75aa3f908a4d16054a1a1b46756d897" + dependencies: + babel-plugin-transform-decorators "7.0.0-alpha.3" + babel-plugin-transform-export-extensions "7.0.0-alpha.3" + babel-preset-stage-2 "7.0.0-alpha.3" + +babel-preset-stage-2@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-7.0.0-alpha.3.tgz#96fab02bced0c6f3a9fda031185abd23ae69a60b" + dependencies: + babel-plugin-syntax-dynamic-import "7.0.0-alpha.3" + babel-plugin-transform-class-properties "7.0.0-alpha.3" + babel-plugin-transform-unicode-property-regex "^2.0.0" + babel-preset-stage-3 "7.0.0-alpha.3" + +babel-preset-stage-3@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-7.0.0-alpha.3.tgz#3196bf3699c980372bc9f260fa0db70786d4d4a1" + dependencies: + babel-plugin-transform-async-generator-functions "7.0.0-alpha.3" + babel-plugin-transform-object-rest-spread "7.0.0-alpha.3" + +babel-register@7.0.0-alpha.6, babel-register@^7.0.0-alpha.6: + version "7.0.0-alpha.6" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-7.0.0-alpha.6.tgz#adb337fdfca6d74c90d51232b5b3d8f532ca91bc" + dependencies: + babel-core "7.0.0-alpha.6" + core-js "^2.4.0" + home-or-tmp "^3.0.0" + lodash "^4.2.0" + mkdirp "^0.5.1" + source-map-support "^0.4.2" babel-register@^6.24.0: version "6.24.0" @@ -945,13 +1088,29 @@ babel-register@^6.24.0: mkdirp "^0.5.1" source-map-support "^0.4.2" -babel-runtime@^6.18.0, babel-runtime@^6.22.0: +babel-runtime@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-7.0.0-alpha.3.tgz#fb71839b64115026a014f62891bdff9bee71079f" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" +babel-template@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-alpha.3.tgz#eff537d49216ae6e70722f3556a17cc3de62b117" + dependencies: + babel-traverse "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + babylon "7.0.0-beta.7" + lodash "^4.2.0" + babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.23.0, babel-template@^6.7.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638" @@ -962,6 +1121,19 @@ babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.23.0, babel-te babylon "^6.11.0" lodash "^4.2.0" +babel-traverse@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.3.tgz#ac5bd86d101b410daf705ff4a6cbfc0123ca49f0" + dependencies: + babel-code-frame "7.0.0-alpha.3" + babel-messages "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" + babylon "7.0.0-beta.7" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + babel-traverse@^6.15.0, babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1: version "6.23.1" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" @@ -976,6 +1148,14 @@ babel-traverse@^6.15.0, babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-tr invariant "^2.2.0" lodash "^4.2.0" +babel-types@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.3.tgz#36c20f7a4e4d3f32fc00ab38893004a6f52b22a8" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + babel-types@^6.15.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0, babel-types@^6.7.2: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" @@ -985,6 +1165,10 @@ babel-types@^6.15.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22 lodash "^4.2.0" to-fast-properties "^1.0.1" +babylon@7.0.0-beta.7: + version "7.0.0-beta.7" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.7.tgz#61454c26b0e285ffe826dd237d5b5d179f602e16" + babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: version "6.16.1" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" @@ -2046,6 +2230,10 @@ home-or-tmp@^2.0.0: os-homedir "^1.0.0" os-tmpdir "^1.0.1" +home-or-tmp@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" + hosted-git-info@^2.1.4: version "2.3.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.3.1.tgz#ac439421605f0beb0ea1349de7d8bb28e50be1dd" @@ -3228,7 +3416,13 @@ redent@^1.0.0: indent-string "^2.1.0" strip-indent "^1.0.1" -regenerate@^1.2.1: +regenerate-unicode-properties@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-4.0.3.tgz#78bdcd84c07c95204ba45ef7bce4f742324ef187" + dependencies: + regenerate "^1.3.1" + +regenerate@^1.2.1, regenerate@^1.3.1, regenerate@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" @@ -3236,9 +3430,9 @@ regenerator-runtime@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" -regenerator-transform@0.9.8: - version "0.9.8" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.8.tgz#0f88bb2bc03932ddb7b6b7312e68078f01026d6c" +regenerator-transform@0.9.11: + version "0.9.11" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.11.tgz#3a7d067520cb7b7176769eb5ff868691befe1283" dependencies: babel-runtime "^6.18.0" babel-types "^6.19.0" @@ -3259,6 +3453,17 @@ regexpu-core@^2.0.0: regjsgen "^0.2.0" regjsparser "^0.1.4" +regexpu-core@^4.0.2, regexpu-core@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.0.4.tgz#06cfa87a883545cc9fd6638d8024ba02b9ebfe69" + dependencies: + regenerate "^1.3.2" + regenerate-unicode-properties "^4.0.3" + regjsgen "^0.3.0" + regjsparser "^0.2.1" + unicode-match-property "^0.1.3" + unicode-match-property-value "^1.0.2" + registry-auth-token@^3.0.1: version "3.1.0" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.1.0.tgz#997c08256e0c7999837b90e944db39d8a790276b" @@ -3275,12 +3480,22 @@ regjsgen@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" +regjsgen@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.3.0.tgz#0ee4a3e9276430cda25f1e789ea6c15b87b0cb43" + regjsparser@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" dependencies: jsesc "~0.5.0" +regjsparser@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.2.1.tgz#c3787553faf04e775c302102ef346d995000ec1c" + dependencies: + jsesc "~0.5.0" + repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" @@ -3363,7 +3578,7 @@ resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.6: +resolve@^1.1.6, resolve@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235" dependencies: @@ -3810,6 +4025,31 @@ unicode-9.0.0@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/unicode-9.0.0/-/unicode-9.0.0-0.7.0.tgz#4d303caf9c6dbf2b979943c18a384e226643b937" +unicode-canonical-property-names@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names/-/unicode-canonical-property-names-1.0.3.tgz#63b0f02971c4812453df221ebd3ef9a16b3ca2ec" + +unicode-match-property-value@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unicode-match-property-value/-/unicode-match-property-value-1.0.2.tgz#55de300b04112a8cb663c0102343c082737714cc" + dependencies: + unicode-property-value-aliases "^1.2.1" + +unicode-match-property@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/unicode-match-property/-/unicode-match-property-0.1.3.tgz#371c7308522b65a2cc4cfbbbe775187f7784352a" + dependencies: + unicode-canonical-property-names "^1.0.3" + unicode-property-aliases "^1.1.0" + +unicode-property-aliases@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unicode-property-aliases/-/unicode-property-aliases-1.1.1.tgz#61f2c004efc1182f0abed5b710f7eeb03eee1361" + +unicode-property-value-aliases@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/unicode-property-value-aliases/-/unicode-property-value-aliases-1.2.2.tgz#12a3746fc66f75f08a3f4a8d56780f89f49acbbd" + unique-temp-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz#6dce95b2681ca003eebfb304a415f9cbabcc5385" From 213fdab0637251a155a16f9debd64d5b14e4e79f Mon Sep 17 00:00:00 2001 From: Conrad Buck Date: Mon, 3 Apr 2017 13:05:05 -0700 Subject: [PATCH 066/105] Add support for flow type spread (#418) * Add support for flow type spread * Broaden spreadable types from primary to all, more tests * Eliminate variance sigil for type spreads, better errors, fix tests --- src/plugins/flow.js | 52 ++-- .../flow/type-annotations/135/actual.js | 3 + .../flow/type-annotations/135/expected.json | 117 ++++++++ .../flow/type-annotations/136/actual.js | 4 + .../flow/type-annotations/136/expected.json | 175 +++++++++++ .../flow/type-annotations/137/actual.js | 3 + .../flow/type-annotations/137/options.json | 3 + .../flow/type-annotations/138/actual.js | 5 + .../flow/type-annotations/138/expected.json | 283 ++++++++++++++++++ .../flow/type-annotations/139/actual.js | 4 + .../flow/type-annotations/139/options.json | 3 + 11 files changed, 634 insertions(+), 18 deletions(-) create mode 100644 test/fixtures/flow/type-annotations/135/actual.js create mode 100644 test/fixtures/flow/type-annotations/135/expected.json create mode 100644 test/fixtures/flow/type-annotations/136/actual.js create mode 100644 test/fixtures/flow/type-annotations/136/expected.json create mode 100644 test/fixtures/flow/type-annotations/137/actual.js create mode 100644 test/fixtures/flow/type-annotations/137/options.json create mode 100644 test/fixtures/flow/type-annotations/138/actual.js create mode 100644 test/fixtures/flow/type-annotations/138/expected.json create mode 100644 test/fixtures/flow/type-annotations/139/actual.js create mode 100644 test/fixtures/flow/type-annotations/139/options.json diff --git a/src/plugins/flow.js b/src/plugins/flow.js index fed1934731..070b512e00 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -219,7 +219,7 @@ pp.flowParseInterfaceish = function (node) { } while (this.eat(tt.comma)); } - node.body = this.flowParseObjectType(true); + node.body = this.flowParseObjectType(true, false, false); }; pp.flowParseInterfaceExtends = function () { @@ -403,7 +403,7 @@ pp.flowParseObjectTypeCallProperty = function (node, isStatic) { return this.finishNode(node, "ObjectTypeCallProperty"); }; -pp.flowParseObjectType = function (allowStatic, allowExact) { +pp.flowParseObjectType = function (allowStatic, allowExact, allowSpread) { const oldInType = this.state.inType; this.state.inType = true; @@ -450,24 +450,40 @@ pp.flowParseObjectType = function (allowStatic, allowExact) { } nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); } else { - propertyKey = this.flowParseObjectPropertyKey(); - if (this.isRelational("<") || this.match(tt.parenL)) { - // This is a method property + if (this.match(tt.ellipsis)) { + if (!allowSpread) { + this.unexpected( + null, + "Spread operator cannnot appear in class or interface definitions" + ); + } if (variance) { - this.unexpected(variance.start); + this.unexpected(variance.start, "Spread properties cannot have variance"); } - nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey)); + this.expect(tt.ellipsis); + node.argument = this.flowParseType(); + this.flowObjectTypeSemicolon(); + nodeStart.properties.push(this.finishNode(node, "ObjectTypeSpreadProperty")); } else { - if (this.eat(tt.question)) { - optional = true; + propertyKey = this.flowParseObjectPropertyKey(); + if (this.isRelational("<") || this.match(tt.parenL)) { + // This is a method property + if (variance) { + this.unexpected(variance.start); + } + nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey)); + } else { + if (this.eat(tt.question)) { + optional = true; + } + node.key = propertyKey; + node.value = this.flowParseTypeInitialiser(); + node.optional = optional; + node.static = isStatic; + node.variance = variance; + this.flowObjectTypeSemicolon(); + nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty")); } - node.key = propertyKey; - node.value = this.flowParseTypeInitialiser(); - node.optional = optional; - node.static = isStatic; - node.variance = variance; - this.flowObjectTypeSemicolon(); - nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty")); } } @@ -629,10 +645,10 @@ pp.flowParsePrimaryType = function () { return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); case tt.braceL: - return this.flowParseObjectType(false, false); + return this.flowParseObjectType(false, false, true); case tt.braceBarL: - return this.flowParseObjectType(false, true); + return this.flowParseObjectType(false, true, true); case tt.bracketL: return this.flowParseTupleType(); diff --git a/test/fixtures/flow/type-annotations/135/actual.js b/test/fixtures/flow/type-annotations/135/actual.js new file mode 100644 index 0000000000..b79dc870ee --- /dev/null +++ b/test/fixtures/flow/type-annotations/135/actual.js @@ -0,0 +1,3 @@ +type A = { + ...any, +}; diff --git a/test/fixtures/flow/type-annotations/135/expected.json b/test/fixtures/flow/type-annotations/135/expected.json new file mode 100644 index 0000000000..6f973de0f6 --- /dev/null +++ b/test/fixtures/flow/type-annotations/135/expected.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "sourceType": "module", + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeSpreadProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "argument": { + "type": "AnyTypeAnnotation", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + } + } + } + ], + "indexers": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/136/actual.js b/test/fixtures/flow/type-annotations/136/actual.js new file mode 100644 index 0000000000..09c0a04398 --- /dev/null +++ b/test/fixtures/flow/type-annotations/136/actual.js @@ -0,0 +1,4 @@ +type A = { + p: {}, + ...{}, +}; diff --git a/test/fixtures/flow/type-annotations/136/expected.json b/test/fixtures/flow/type-annotations/136/expected.json new file mode 100644 index 0000000000..18d746c433 --- /dev/null +++ b/test/fixtures/flow/type-annotations/136/expected.json @@ -0,0 +1,175 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 2 + } + }, + "sourceType": "module", + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 2 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 9, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 2 + }, + "identifierName": "p" + }, + "name": "p" + }, + "value": { + "type": "ObjectTypeAnnotation", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "exact": false + }, + "optional": false, + "static": false, + "variance": null + }, + { + "type": "ObjectTypeSpreadProperty", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "argument": { + "type": "ObjectTypeAnnotation", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "exact": false + } + } + ], + "indexers": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/137/actual.js b/test/fixtures/flow/type-annotations/137/actual.js new file mode 100644 index 0000000000..b039a41ed2 --- /dev/null +++ b/test/fixtures/flow/type-annotations/137/actual.js @@ -0,0 +1,3 @@ +interface A { + ...any, +}; diff --git a/test/fixtures/flow/type-annotations/137/options.json b/test/fixtures/flow/type-annotations/137/options.json new file mode 100644 index 0000000000..79756f8c33 --- /dev/null +++ b/test/fixtures/flow/type-annotations/137/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Spread operator cannnot appear in class or interface definitions (2:1)" +} diff --git a/test/fixtures/flow/type-annotations/138/actual.js b/test/fixtures/flow/type-annotations/138/actual.js new file mode 100644 index 0000000000..9a607c669f --- /dev/null +++ b/test/fixtures/flow/type-annotations/138/actual.js @@ -0,0 +1,5 @@ +class A {} +class B {} +type C = { + ...A&B +}; diff --git a/test/fixtures/flow/type-annotations/138/expected.json b/test/fixtures/flow/type-annotations/138/expected.json new file mode 100644 index 0000000000..3aabc9dfd3 --- /dev/null +++ b/test/fixtures/flow/type-annotations/138/expected.json @@ -0,0 +1,283 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [] + } + }, + { + "type": "ClassDeclaration", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "B" + }, + "name": "B" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "body": [] + } + }, + { + "type": "TypeAlias", + "start": 22, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 6 + }, + "identifierName": "C" + }, + "name": "C" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 31, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeSpreadProperty", + "start": 34, + "end": 40, + "loc": { + "start": { + "line": 4, + "column": 1 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "argument": { + "type": "IntersectionTypeAnnotation", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "types": [ + { + "type": "GenericTypeAnnotation", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + } + }, + { + "type": "GenericTypeAnnotation", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + }, + "identifierName": "B" + }, + "name": "B" + } + } + ] + } + } + ], + "indexers": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/139/actual.js b/test/fixtures/flow/type-annotations/139/actual.js new file mode 100644 index 0000000000..fbc1330612 --- /dev/null +++ b/test/fixtures/flow/type-annotations/139/actual.js @@ -0,0 +1,4 @@ +class A {} +type C = { + -...A +}; diff --git a/test/fixtures/flow/type-annotations/139/options.json b/test/fixtures/flow/type-annotations/139/options.json new file mode 100644 index 0000000000..835e923674 --- /dev/null +++ b/test/fixtures/flow/type-annotations/139/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Spread properties cannot have variance (3:1)" +} \ No newline at end of file From 786d73b2ce28f98bdea5a9981cd1b5764091303e Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Mon, 3 Apr 2017 22:23:02 +0200 Subject: [PATCH 067/105] =?UTF-8?q?Update=20rollup-plugin-node-resolve=20t?= =?UTF-8?q?o=20the=20latest=20version=20=F0=9F=9A=80=20(#445)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update rollup-plugin-node-resolve to version 3.0.0 https://greenkeeper.io/ * Update yarn.lock --- package.json | 2 +- yarn.lock | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 46f25f21f1..458c11ac49 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "rimraf": "^2.5.4", "rollup": "^0.41.0", "rollup-plugin-babel": "^2.6.1", - "rollup-plugin-node-resolve": "^2.0.0", + "rollup-plugin-node-resolve": "^3.0.0", "rollup-watch": "^3.2.2", "unicode-9.0.0": "~0.7.0" }, diff --git a/yarn.lock b/yarn.lock index f1c57a9407..5fcc1cff35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1065,7 +1065,7 @@ babel-preset-stage-3@7.0.0-alpha.3: babel-plugin-transform-async-generator-functions "7.0.0-alpha.3" babel-plugin-transform-object-rest-spread "7.0.0-alpha.3" -babel-register@7.0.0-alpha.6, babel-register@^7.0.0-alpha.6: +babel-register@7.0.0-alpha.6: version "7.0.0-alpha.6" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-7.0.0-alpha.6.tgz#adb337fdfca6d74c90d51232b5b3d8f532ca91bc" dependencies: @@ -2393,6 +2393,10 @@ is-glob@^2.0.0, is-glob@^2.0.1: dependencies: is-extglob "^1.0.0" +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + is-my-json-valid@^2.10.0: version "2.16.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" @@ -3625,12 +3629,13 @@ rollup-plugin-babel@^2.6.1: object-assign "^4.1.0" rollup-pluginutils "^1.5.0" -rollup-plugin-node-resolve@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.0.0.tgz#07e0ae94ac002a3ea36e8f33ca121d9f836b1309" +rollup-plugin-node-resolve@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.0.tgz#8b897c4c3030d5001277b0514b25d2ca09683ee0" dependencies: browser-resolve "^1.11.0" builtin-modules "^1.1.0" + is-module "^1.0.0" resolve "^1.1.6" rollup-pluginutils@^1.5.0: From 9222562b8211d1d6a507e8948fffb5312b5f7be5 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Mon, 3 Apr 2017 22:23:44 +0200 Subject: [PATCH 068/105] =?UTF-8?q?Update=20cross-env=20to=20the=20latest?= =?UTF-8?q?=20version=20=F0=9F=9A=80=20(#443)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update cross-env to version 4.0.0 https://greenkeeper.io/ * Update yarn.lock --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 458c11ac49..e91bbf38f6 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "babel-preset-es2015": "^7.0.0-alpha.3", "babel-preset-stage-0": "^7.0.0-alpha.3", "chalk": "^1.1.3", - "cross-env": "^3.1.4", + "cross-env": "^4.0.0", "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.20.0", diff --git a/yarn.lock b/yarn.lock index 5fcc1cff35..053ad947e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1510,9 +1510,9 @@ create-error-class@^3.0.1: dependencies: capture-stack-trace "^1.0.0" -cross-env@^3.1.4: - version "3.2.4" - resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-3.2.4.tgz#9e0585f277864ed421ce756f81a980ff0d698aba" +cross-env@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-4.0.0.tgz#16083862d08275a4628b0b243b121bedaa55dd80" dependencies: cross-spawn "^5.1.0" is-windows "^1.0.0" From 22741a8068d436a54811fc77ae7f60b7e6404a79 Mon Sep 17 00:00:00 2001 From: Alex Kuzmenko Date: Mon, 3 Apr 2017 23:25:29 +0300 Subject: [PATCH 069/105] Fix number parser (#433) Fixed number parser #2 Added one more test --- src/tokenizer/index.js | 8 ++- .../core/uncategorised/355/expected.json | 69 +++++++++++++++++++ .../core/uncategorised/355/options.json | 3 - .../core/uncategorised/356/expected.json | 69 +++++++++++++++++++ .../core/uncategorised/356/options.json | 3 - .../fixtures/core/uncategorised/550/actual.js | 2 + .../core/uncategorised/550/options.json | 3 + .../fixtures/core/uncategorised/551/actual.js | 1 + .../core/uncategorised/551/expected.json | 69 +++++++++++++++++++ .../fixtures/core/uncategorised/552/actual.js | 2 + .../core/uncategorised/552/options.json | 3 + .../fixtures/core/uncategorised/553/actual.js | 1 + .../core/uncategorised/553/expected.json | 69 +++++++++++++++++++ 13 files changed, 293 insertions(+), 9 deletions(-) create mode 100644 test/fixtures/core/uncategorised/355/expected.json delete mode 100644 test/fixtures/core/uncategorised/355/options.json create mode 100644 test/fixtures/core/uncategorised/356/expected.json delete mode 100644 test/fixtures/core/uncategorised/356/options.json create mode 100644 test/fixtures/core/uncategorised/550/actual.js create mode 100644 test/fixtures/core/uncategorised/550/options.json create mode 100644 test/fixtures/core/uncategorised/551/actual.js create mode 100644 test/fixtures/core/uncategorised/551/expected.json create mode 100644 test/fixtures/core/uncategorised/552/actual.js create mode 100644 test/fixtures/core/uncategorised/552/options.json create mode 100644 test/fixtures/core/uncategorised/553/actual.js create mode 100644 test/fixtures/core/uncategorised/553/expected.json diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index a058ba91a5..076b636381 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -564,7 +564,7 @@ export default class Tokenizer { readNumber(startsWithDot) { const start = this.state.pos; - const octal = this.input.charCodeAt(this.state.pos) === 48; + const firstIsZero = this.input.charCodeAt(start) === 48; // '0' let isFloat = false; if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number"); @@ -587,10 +587,12 @@ export default class Tokenizer { let val; if (isFloat) { val = parseFloat(str); - } else if (!octal || str.length === 1) { + } else if (!firstIsZero || str.length === 1) { val = parseInt(str, 10); - } else if (/[89]/.test(str) || this.state.strict) { + } else if (this.state.strict) { this.raise(start, "Invalid number"); + } else if (/[89]/.test(str)) { + val = parseInt(str, 10); } else { val = parseInt(str, 8); } diff --git a/test/fixtures/core/uncategorised/355/expected.json b/test/fixtures/core/uncategorised/355/expected.json new file mode 100644 index 0000000000..08de8c762b --- /dev/null +++ b/test/fixtures/core/uncategorised/355/expected.json @@ -0,0 +1,69 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 9, + "raw": "09" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/355/options.json b/test/fixtures/core/uncategorised/355/options.json deleted file mode 100644 index cf3086295c..0000000000 --- a/test/fixtures/core/uncategorised/355/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid number (1:0)" -} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/356/expected.json b/test/fixtures/core/uncategorised/356/expected.json new file mode 100644 index 0000000000..6d04954399 --- /dev/null +++ b/test/fixtures/core/uncategorised/356/expected.json @@ -0,0 +1,69 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 18, + "raw": "018" + }, + "value": 18 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/356/options.json b/test/fixtures/core/uncategorised/356/options.json deleted file mode 100644 index cf3086295c..0000000000 --- a/test/fixtures/core/uncategorised/356/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid number (1:0)" -} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/550/actual.js b/test/fixtures/core/uncategorised/550/actual.js new file mode 100644 index 0000000000..64dcf36896 --- /dev/null +++ b/test/fixtures/core/uncategorised/550/actual.js @@ -0,0 +1,2 @@ +'use strict'; +const a = 07; diff --git a/test/fixtures/core/uncategorised/550/options.json b/test/fixtures/core/uncategorised/550/options.json new file mode 100644 index 0000000000..f635fb88c5 --- /dev/null +++ b/test/fixtures/core/uncategorised/550/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid number (2:10)" +} diff --git a/test/fixtures/core/uncategorised/551/actual.js b/test/fixtures/core/uncategorised/551/actual.js new file mode 100644 index 0000000000..524f32795d --- /dev/null +++ b/test/fixtures/core/uncategorised/551/actual.js @@ -0,0 +1 @@ +0111 \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/551/expected.json b/test/fixtures/core/uncategorised/551/expected.json new file mode 100644 index 0000000000..07311dd1eb --- /dev/null +++ b/test/fixtures/core/uncategorised/551/expected.json @@ -0,0 +1,69 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 73, + "raw": "0111" + }, + "value": 73 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/552/actual.js b/test/fixtures/core/uncategorised/552/actual.js new file mode 100644 index 0000000000..63f4544f72 --- /dev/null +++ b/test/fixtures/core/uncategorised/552/actual.js @@ -0,0 +1,2 @@ +'use strict'; +const a = 08; diff --git a/test/fixtures/core/uncategorised/552/options.json b/test/fixtures/core/uncategorised/552/options.json new file mode 100644 index 0000000000..f635fb88c5 --- /dev/null +++ b/test/fixtures/core/uncategorised/552/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid number (2:10)" +} diff --git a/test/fixtures/core/uncategorised/553/actual.js b/test/fixtures/core/uncategorised/553/actual.js new file mode 100644 index 0000000000..6b07531279 --- /dev/null +++ b/test/fixtures/core/uncategorised/553/actual.js @@ -0,0 +1 @@ +0274134317073 \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/553/expected.json b/test/fixtures/core/uncategorised/553/expected.json new file mode 100644 index 0000000000..756da7f491 --- /dev/null +++ b/test/fixtures/core/uncategorised/553/expected.json @@ -0,0 +1,69 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 25257156155, + "raw": "0274134317073" + }, + "value": 25257156155 + } + } + ], + "directives": [] + } +} \ No newline at end of file From 14b7f50e514486375bca7fbc11d63e5e1ad9e317 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Mon, 3 Apr 2017 15:27:43 -0500 Subject: [PATCH 070/105] Fix rest parameters with array and objects (#424) * Fix rest parameters with array and objects * Add test for array rest with object * reuse parseBindingIdentifier --- src/parser/lval.js | 7 +- .../array-rest-spread/with-object/actual.js | 1 + .../with-object/expected.json | 248 +++++++++ .../es2015/uncategorised/167/expected.json | 154 ++++++ .../es2015/uncategorised/167/options.json | 3 - .../es2015/uncategorised/168/expected.json | 436 ++++++++++++++++ .../es2015/uncategorised/168/options.json | 3 - .../es2015/uncategorised/171/expected.json | 173 +++++++ .../es2015/uncategorised/171/options.json | 3 - .../es2015/uncategorised/172/expected.json | 455 +++++++++++++++++ .../es2015/uncategorised/172/options.json | 3 - .../es2015/uncategorised/174/expected.json | 195 +++++++ .../es2015/uncategorised/174/options.json | 3 - .../es2015/uncategorised/175/expected.json | 477 ++++++++++++++++++ .../es2015/uncategorised/175/options.json | 3 - .../es2015/uncategorised/180/expected.json | 153 ++++++ .../es2015/uncategorised/180/options.json | 3 - .../es2015/uncategorised/181/expected.json | 153 ++++++ .../es2015/uncategorised/181/options.json | 3 - .../es2015/uncategorised/279/expected.json | 175 +++++++ .../es2015/uncategorised/279/options.json | 3 - .../es2015/uncategorised/286/options.json | 2 +- .../options.json | 2 +- .../options.json | 4 +- .../options.json | 4 +- .../options.json | 4 +- .../options.json | 4 +- .../options.json | 4 +- .../options.json | 4 +- .../options.json | 4 +- .../options.json | 4 +- .../options.json | 4 +- .../invalid-syntax/migrated_0231/options.json | 4 +- .../invalid-syntax/migrated_0259/actual.js | 1 - .../invalid-syntax/migrated_0259/options.json | 3 - .../arrow-rest-parameter-array/actual.js | 1 + .../arrow-rest-parameter-array/expected.json | 153 ++++++ .../arrow-rest-parameter-object/actual.js | 1 + .../arrow-rest-parameter-object/expected.json | 191 +++++++ .../function-declaration/actual.js | 1 + .../function-declaration/expected.json | 137 +++++ .../function-expression/actual.js | 1 + .../function-expression/expected.json | 169 +++++++ .../invalid-setter-rest/actual.js | 1 + .../invalid-setter-rest/expected.json | 190 +++++++ .../rest-parameter/object-method/actual.js | 1 + .../object-method/expected.json | 221 ++++++++ .../object-shorthand-method/actual.js | 1 + .../object-shorthand-method/expected.json | 190 +++++++ .../rest-parameter-array/actual.js | 1 + .../rest-parameter-array/expected.json | 137 +++++ .../rest-parameter-object/actual.js | 1 + .../rest-parameter-object/expected.json | 175 +++++++ .../array-pattern-empty-with-array/actual.js | 1 + .../expected.json | 136 +++++ .../actual.js | 1 + .../expected.json | 136 +++++ .../array-pattern-empty-with-object/actual.js | 1 + .../expected.json | 136 +++++ .../array-pattern-empty-with-rest/actual.js | 1 + .../expected.json | 151 ++++++ .../array-pattern-empty/actual.js | 1 + .../array-pattern-empty/expected.json | 119 +++++ .../actual.js | 1 + .../expected.json | 205 ++++++++ .../actual.js | 1 + .../expected.json | 241 +++++++++ .../actual.js | 1 + .../expected.json | 205 ++++++++ .../actual.js | 1 + .../expected.json | 368 ++++++++++++++ .../actual.js | 1 + .../expected.json | 186 +++++++ .../array-pattern-multi-element/actual.js | 1 + .../array-pattern-multi-element/expected.json | 171 +++++++ .../actual.js | 1 + .../expected.json | 154 ++++++ .../actual.js | 1 + .../expected.json | 172 +++++++ .../actual.js | 1 + .../expected.json | 154 ++++++ .../actual.js | 1 + .../expected.json | 189 +++++++ .../actual.js | 1 + .../expected.json | 152 ++++++ .../array-pattern-single-element/actual.js | 1 + .../expected.json | 137 +++++ .../object-pattern-empty-with-array/actual.js | 1 + .../expected.json | 171 +++++++ .../actual.js | 1 + .../expected.json | 136 +++++ .../actual.js | 1 + .../expected.json | 171 +++++++ .../object-pattern-empty/actual.js | 1 + .../object-pattern-empty/expected.json | 119 +++++ .../actual.js | 1 + .../expected.json | 313 ++++++++++++ .../actual.js | 1 + .../expected.json | 346 +++++++++++++ .../actual.js | 1 + .../expected.json | 310 ++++++++++++ .../actual.js | 1 + .../expected.json | 473 +++++++++++++++++ .../object-pattern-multi-element/actual.js | 1 + .../expected.json | 276 ++++++++++ .../actual.js | 1 + .../expected.json | 189 +++++++ .../actual.js | 1 + .../expected.json | 207 ++++++++ .../actual.js | 1 + .../expected.json | 189 +++++++ .../actual.js | 1 + .../expected.json | 224 ++++++++ .../object-pattern-single-element/actual.js | 1 + .../expected.json | 172 +++++++ 115 files changed, 10555 insertions(+), 58 deletions(-) create mode 100644 test/fixtures/es2015/array-rest-spread/with-object/actual.js create mode 100644 test/fixtures/es2015/array-rest-spread/with-object/expected.json create mode 100644 test/fixtures/es2015/uncategorised/167/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/167/options.json create mode 100644 test/fixtures/es2015/uncategorised/168/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/168/options.json create mode 100644 test/fixtures/es2015/uncategorised/171/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/171/options.json create mode 100644 test/fixtures/es2015/uncategorised/172/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/172/options.json create mode 100644 test/fixtures/es2015/uncategorised/174/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/174/options.json create mode 100644 test/fixtures/es2015/uncategorised/175/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/175/options.json create mode 100644 test/fixtures/es2015/uncategorised/180/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/180/options.json create mode 100644 test/fixtures/es2015/uncategorised/181/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/181/options.json create mode 100644 test/fixtures/es2015/uncategorised/279/expected.json delete mode 100644 test/fixtures/es2015/uncategorised/279/options.json delete mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js delete mode 100644 test/fixtures/esprima/invalid-syntax/migrated_0259/options.json create mode 100644 test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/actual.js create mode 100644 test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/expected.json create mode 100644 test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/actual.js create mode 100644 test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/expected.json create mode 100644 test/fixtures/esprima/rest-parameter/function-declaration/actual.js create mode 100644 test/fixtures/esprima/rest-parameter/function-declaration/expected.json create mode 100644 test/fixtures/esprima/rest-parameter/function-expression/actual.js create mode 100644 test/fixtures/esprima/rest-parameter/function-expression/expected.json create mode 100644 test/fixtures/esprima/rest-parameter/invalid-setter-rest/actual.js create mode 100644 test/fixtures/esprima/rest-parameter/invalid-setter-rest/expected.json create mode 100644 test/fixtures/esprima/rest-parameter/object-method/actual.js create mode 100644 test/fixtures/esprima/rest-parameter/object-method/expected.json create mode 100644 test/fixtures/esprima/rest-parameter/object-shorthand-method/actual.js create mode 100644 test/fixtures/esprima/rest-parameter/object-shorthand-method/expected.json create mode 100644 test/fixtures/esprima/rest-parameter/rest-parameter-array/actual.js create mode 100644 test/fixtures/esprima/rest-parameter/rest-parameter-array/expected.json create mode 100644 test/fixtures/esprima/rest-parameter/rest-parameter-object/actual.js create mode 100644 test/fixtures/esprima/rest-parameter/rest-parameter-object/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-empty/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-empty/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-multi-element/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/expected.json create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element/actual.js create mode 100644 test/fixtures/test262/rest-parameter/array-pattern-single-element/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-empty/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-empty/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-multi-element/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-multi-element/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/expected.json create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-single-element/actual.js create mode 100644 test/fixtures/test262/rest-parameter/object-pattern-single-element/expected.json diff --git a/src/parser/lval.js b/src/parser/lval.js index 60c26ec9f3..9f0f7566c7 100644 --- a/src/parser/lval.js +++ b/src/parser/lval.js @@ -110,7 +110,7 @@ pp.parseSpread = function (refShorthandDefaultPos) { pp.parseRest = function () { const node = this.startNode(); this.next(); - node.argument = this.parseBindingIdentifier(); + node.argument = this.parseBindingAtom(); return this.finishNode(node, "RestElement"); }; @@ -123,14 +123,11 @@ pp.parseBindingIdentifier = function () { }; // Parses lvalue (assignable) atom. - pp.parseBindingAtom = function () { switch (this.state.type) { case tt._yield: - if (this.state.strict || this.state.inGenerator) this.unexpected(); - // fall-through case tt.name: - return this.parseIdentifier(true); + return this.parseBindingIdentifier(); case tt.bracketL: const node = this.startNode(); diff --git a/test/fixtures/es2015/array-rest-spread/with-object/actual.js b/test/fixtures/es2015/array-rest-spread/with-object/actual.js new file mode 100644 index 0000000000..8bf2600909 --- /dev/null +++ b/test/fixtures/es2015/array-rest-spread/with-object/actual.js @@ -0,0 +1 @@ +var [...{length}] = [ 1, 2, 3]; diff --git a/test/fixtures/es2015/array-rest-spread/with-object/expected.json b/test/fixtures/es2015/array-rest-spread/with-object/expected.json new file mode 100644 index 0000000000..bf10b699ac --- /dev/null +++ b/test/fixtures/es2015/array-rest-spread/with-object/expected.json @@ -0,0 +1,248 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [ + { + "type": "RestElement", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "length" + }, + "name": "length" + }, + "value": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "length" + }, + "name": "length" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + }, + { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + ] + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/167/expected.json b/test/fixtures/es2015/uncategorised/167/expected.json new file mode 100644 index 0000000000..83e3c57d2c --- /dev/null +++ b/test/fixtures/es2015/uncategorised/167/expected.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 11, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 14, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/167/options.json b/test/fixtures/es2015/uncategorised/167/options.json deleted file mode 100644 index d50e8469b8..0000000000 --- a/test/fixtures/es2015/uncategorised/167/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:14)" -} diff --git a/test/fixtures/es2015/uncategorised/168/expected.json b/test/fixtures/es2015/uncategorised/168/expected.json new file mode 100644 index 0000000000..009f02d6c5 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/168/expected.json @@ -0,0 +1,436 @@ +{ + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 11, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "ObjectPattern", + "start": 16, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "w" + }, + "name": "w" + }, + "value": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "w" + }, + "name": "w" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "ArrayPattern", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "y" + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "z" + }, + "name": "z" + } + ] + } + } + ] + }, + { + "type": "RestElement", + "start": 39, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 42, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 49, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 50 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 52, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/168/options.json b/test/fixtures/es2015/uncategorised/168/options.json deleted file mode 100644 index 9ac2c7432d..0000000000 --- a/test/fixtures/es2015/uncategorised/168/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:42)" -} diff --git a/test/fixtures/es2015/uncategorised/171/expected.json b/test/fixtures/es2015/uncategorised/171/expected.json new file mode 100644 index 0000000000..ec25a3ef37 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/171/expected.json @@ -0,0 +1,173 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/171/options.json b/test/fixtures/es2015/uncategorised/171/options.json deleted file mode 100644 index 98d7123790..0000000000 --- a/test/fixtures/es2015/uncategorised/171/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:15)" -} diff --git a/test/fixtures/es2015/uncategorised/172/expected.json b/test/fixtures/es2015/uncategorised/172/expected.json new file mode 100644 index 0000000000..3f75c7c880 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/172/expected.json @@ -0,0 +1,455 @@ +{ + "type": "File", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 12, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "ObjectPattern", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "w" + }, + "name": "w" + }, + "value": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "w" + }, + "name": "w" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 27, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "ArrayPattern", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "y" + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "z" + }, + "name": "z" + } + ] + } + } + ] + }, + { + "type": "RestElement", + "start": 40, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 43, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 48 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 53, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/172/options.json b/test/fixtures/es2015/uncategorised/172/options.json deleted file mode 100644 index ceee1cc2ef..0000000000 --- a/test/fixtures/es2015/uncategorised/172/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:43)" -} diff --git a/test/fixtures/es2015/uncategorised/174/expected.json b/test/fixtures/es2015/uncategorised/174/expected.json new file mode 100644 index 0000000000..f430150fa0 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/174/expected.json @@ -0,0 +1,195 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/174/options.json b/test/fixtures/es2015/uncategorised/174/options.json deleted file mode 100644 index 9ce9658f7d..0000000000 --- a/test/fixtures/es2015/uncategorised/174/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:8)" -} diff --git a/test/fixtures/es2015/uncategorised/175/expected.json b/test/fixtures/es2015/uncategorised/175/expected.json new file mode 100644 index 0000000000..04aba9b49f --- /dev/null +++ b/test/fixtures/es2015/uncategorised/175/expected.json @@ -0,0 +1,477 @@ +{ + "type": "File", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 5, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 7, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "ObjectPattern", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "w" + }, + "name": "w" + }, + "value": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "w" + }, + "name": "w" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "x" + }, + "name": "x" + }, + "value": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "ArrayPattern", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "y" + }, + "name": "y" + }, + { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "z" + }, + "name": "z" + } + ] + } + } + ] + }, + { + "type": "RestElement", + "start": 33, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 36, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 46, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/175/options.json b/test/fixtures/es2015/uncategorised/175/options.json deleted file mode 100644 index 4914c41568..0000000000 --- a/test/fixtures/es2015/uncategorised/175/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:36)" -} diff --git a/test/fixtures/es2015/uncategorised/180/expected.json b/test/fixtures/es2015/uncategorised/180/expected.json new file mode 100644 index 0000000000..60ac7f04f6 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/180/expected.json @@ -0,0 +1,153 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/180/options.json b/test/fixtures/es2015/uncategorised/180/options.json deleted file mode 100644 index 27a7b64d71..0000000000 --- a/test/fixtures/es2015/uncategorised/180/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:4)" -} diff --git a/test/fixtures/es2015/uncategorised/181/expected.json b/test/fixtures/es2015/uncategorised/181/expected.json new file mode 100644 index 0000000000..abd0b99c56 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/181/expected.json @@ -0,0 +1,153 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/181/options.json b/test/fixtures/es2015/uncategorised/181/options.json deleted file mode 100644 index c958665c03..0000000000 --- a/test/fixtures/es2015/uncategorised/181/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:7)" -} diff --git a/test/fixtures/es2015/uncategorised/279/expected.json b/test/fixtures/es2015/uncategorised/279/expected.json new file mode 100644 index 0000000000..e2a39dc8b2 --- /dev/null +++ b/test/fixtures/es2015/uncategorised/279/expected.json @@ -0,0 +1,175 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 11, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/279/options.json b/test/fixtures/es2015/uncategorised/279/options.json deleted file mode 100644 index 51c483f3d3..0000000000 --- a/test/fixtures/es2015/uncategorised/279/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:14)" -} \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/286/options.json b/test/fixtures/es2015/uncategorised/286/options.json index 27a7b64d71..158f0af7b4 100644 --- a/test/fixtures/es2015/uncategorised/286/options.json +++ b/test/fixtures/es2015/uncategorised/286/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:4)" + "throws": "Unexpected token (1:6)" } diff --git a/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json b/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json index 158f0af7b4..4ebe77e8fc 100644 --- a/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json +++ b/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:6)" + "throws": "Argument name clash in strict mode (1:7)" } diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json index 7b7329bb7e..5ebcbbe858 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:30)" -} \ No newline at end of file + "throws": "yield is a reserved word (1:30)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json index aca079ee39..ab645bdf60 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:20)" -} \ No newline at end of file + "throws": "yield is a reserved word (1:20)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json index c9ba88af97..f4504039ab 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:47)" -} \ No newline at end of file + "throws": "yield is a reserved word (1:47)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json index aca079ee39..ab645bdf60 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:20)" -} \ No newline at end of file + "throws": "yield is a reserved word (1:20)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json index 2ddc9e708f..b29ca62b42 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:23)" -} \ No newline at end of file + "throws": "yield is a reserved word (1:23)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json index f55830c1c3..5d2e075e37 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:28)" -} \ No newline at end of file + "throws": "yield is a reserved word (1:28)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json index b242442b4c..4e58c050ba 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:25)" -} \ No newline at end of file + "throws": "yield is a reserved word (1:25)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json index 2a73699bc2..a6620a0567 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:18)" -} \ No newline at end of file + "throws": "yield is a reserved word (1:18)" +} diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json index 2a73699bc2..a6620a0567 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:18)" -} \ No newline at end of file + "throws": "yield is a reserved word (1:18)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json index 22d103a833..1edd04b2e0 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token (1:37)" -} \ No newline at end of file + "throws": "yield is a reserved word (1:37)" +} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js b/test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js deleted file mode 100644 index e632766388..0000000000 --- a/test/fixtures/esprima/invalid-syntax/migrated_0259/actual.js +++ /dev/null @@ -1 +0,0 @@ -function x(...{ a }){} diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0259/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0259/options.json deleted file mode 100644 index 51c483f3d3..0000000000 --- a/test/fixtures/esprima/invalid-syntax/migrated_0259/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:14)" -} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/actual.js b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/actual.js new file mode 100644 index 0000000000..3deff8cedd --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/actual.js @@ -0,0 +1 @@ +(a, ...[b]) => c diff --git a/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/expected.json b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/expected.json new file mode 100644 index 0000000000..4bdc1344d7 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/expected.json @@ -0,0 +1,153 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + } + } + ], + "body": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "c" + }, + "name": "c" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/actual.js b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/actual.js new file mode 100644 index 0000000000..5f444a41be --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/actual.js @@ -0,0 +1 @@ +(a, ...{b}) => c diff --git a/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/expected.json b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/expected.json new file mode 100644 index 0000000000..ea2b1244f6 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/expected.json @@ -0,0 +1,191 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ], + "body": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "c" + }, + "name": "c" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/function-declaration/actual.js b/test/fixtures/esprima/rest-parameter/function-declaration/actual.js new file mode 100644 index 0000000000..712e8692f7 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/function-declaration/actual.js @@ -0,0 +1 @@ +function f(a, ...b) {} diff --git a/test/fixtures/esprima/rest-parameter/function-declaration/expected.json b/test/fixtures/esprima/rest-parameter/function-declaration/expected.json new file mode 100644 index 0000000000..07716be5ae --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/function-declaration/expected.json @@ -0,0 +1,137 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "argument": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/function-expression/actual.js b/test/fixtures/esprima/rest-parameter/function-expression/actual.js new file mode 100644 index 0000000000..fa971224bb --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/function-expression/actual.js @@ -0,0 +1 @@ +f = function(a, ...b) {} diff --git a/test/fixtures/esprima/rest-parameter/function-expression/expected.json b/test/fixtures/esprima/rest-parameter/function-expression/expected.json new file mode 100644 index 0000000000..8c72a24d81 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/function-expression/expected.json @@ -0,0 +1,169 @@ +{ + "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": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "f" + }, + "name": "f" + }, + "right": { + "type": "FunctionExpression", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "argument": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/invalid-setter-rest/actual.js b/test/fixtures/esprima/rest-parameter/invalid-setter-rest/actual.js new file mode 100644 index 0000000000..3967f6fba2 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/invalid-setter-rest/actual.js @@ -0,0 +1 @@ +x = { set f(...y) {} } diff --git a/test/fixtures/esprima/rest-parameter/invalid-setter-rest/expected.json b/test/fixtures/esprima/rest-parameter/invalid-setter-rest/expected.json new file mode 100644 index 0000000000..06e1f71eea --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/invalid-setter-rest/expected.json @@ -0,0 +1,190 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "f" + }, + "name": "f" + }, + "kind": "set", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "argument": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "y" + }, + "name": "y" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/object-method/actual.js b/test/fixtures/esprima/rest-parameter/object-method/actual.js new file mode 100644 index 0000000000..af5910b4fc --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/object-method/actual.js @@ -0,0 +1 @@ +o = { f: function(a, ...b) {} } diff --git a/test/fixtures/esprima/rest-parameter/object-method/expected.json b/test/fixtures/esprima/rest-parameter/object-method/expected.json new file mode 100644 index 0000000000..44a231cab5 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/object-method/expected.json @@ -0,0 +1,221 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "o" + }, + "name": "o" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "f" + }, + "name": "f" + }, + "value": { + "type": "FunctionExpression", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 21, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "argument": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [], + "directives": [] + } + } + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/object-shorthand-method/actual.js b/test/fixtures/esprima/rest-parameter/object-shorthand-method/actual.js new file mode 100644 index 0000000000..5099434fef --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/object-shorthand-method/actual.js @@ -0,0 +1 @@ +x = { method(...test) { } } diff --git a/test/fixtures/esprima/rest-parameter/object-shorthand-method/expected.json b/test/fixtures/esprima/rest-parameter/object-shorthand-method/expected.json new file mode 100644 index 0000000000..2d6b8d4961 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/object-shorthand-method/expected.json @@ -0,0 +1,190 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "method": true, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "method" + }, + "name": "method" + }, + "kind": "method", + "id": null, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "argument": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "test" + }, + "name": "test" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/rest-parameter-array/actual.js b/test/fixtures/esprima/rest-parameter/rest-parameter-array/actual.js new file mode 100644 index 0000000000..be49b91260 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/rest-parameter-array/actual.js @@ -0,0 +1 @@ +function f(...[a]) {} diff --git a/test/fixtures/esprima/rest-parameter/rest-parameter-array/expected.json b/test/fixtures/esprima/rest-parameter/rest-parameter-array/expected.json new file mode 100644 index 0000000000..5baa9cff60 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/rest-parameter-array/expected.json @@ -0,0 +1,137 @@ +{ + "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": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/esprima/rest-parameter/rest-parameter-object/actual.js b/test/fixtures/esprima/rest-parameter/rest-parameter-object/actual.js new file mode 100644 index 0000000000..96eaa62074 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/rest-parameter-object/actual.js @@ -0,0 +1 @@ +function f(...{a}) {} diff --git a/test/fixtures/esprima/rest-parameter/rest-parameter-object/expected.json b/test/fixtures/esprima/rest-parameter/rest-parameter-object/expected.json new file mode 100644 index 0000000000..2d0c8bee41 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/rest-parameter-object/expected.json @@ -0,0 +1,175 @@ +{ + "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": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/actual.js new file mode 100644 index 0000000000..e0d33212c9 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/actual.js @@ -0,0 +1 @@ +function emptyWithArray(...[[]]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/expected.json new file mode 100644 index 0000000000..e52b51e72f --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/expected.json @@ -0,0 +1,136 @@ +{ + "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": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "emptyWithArray" + }, + "name": "emptyWithArray" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 24, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "elements": [] + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/actual.js new file mode 100644 index 0000000000..2c899c5287 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/actual.js @@ -0,0 +1 @@ +function emptyWithLeading(x, ...[]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/expected.json new file mode 100644 index 0000000000..6e97288c68 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/expected.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "emptyWithLeading" + }, + "name": "emptyWithLeading" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "RestElement", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "elements": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/actual.js new file mode 100644 index 0000000000..454e0efeba --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/actual.js @@ -0,0 +1 @@ +function emptyWithObject(...[{}]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/expected.json new file mode 100644 index 0000000000..fae5451a85 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/expected.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "emptyWithObject" + }, + "name": "emptyWithObject" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 28, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [] + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/actual.js new file mode 100644 index 0000000000..1c8813cc96 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/actual.js @@ -0,0 +1 @@ +function emptyWithRest(...[...[]]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/expected.json new file mode 100644 index 0000000000..619f048343 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/expected.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "emptyWithRest" + }, + "name": "emptyWithRest" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 23, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "elements": [ + { + "type": "RestElement", + "start": 27, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "elements": [] + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-empty/actual.js new file mode 100644 index 0000000000..3ce6694764 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty/actual.js @@ -0,0 +1 @@ +function empty(...[]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-empty/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-empty/expected.json new file mode 100644 index 0000000000..8fce044f0d --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty/expected.json @@ -0,0 +1,119 @@ +{ + "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": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "empty" + }, + "name": "empty" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "elements": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/actual.js new file mode 100644 index 0000000000..1b3f8e088c --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/actual.js @@ -0,0 +1 @@ +function multiElementWithArray(...[[a], b, [c]]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/expected.json new file mode 100644 index 0000000000..365a587997 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/expected.json @@ -0,0 +1,205 @@ +{ + "type": "File", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "multiElementWithArray" + }, + "name": "multiElementWithArray" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 31, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 34, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + }, + { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "ArrayPattern", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 49, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/actual.js new file mode 100644 index 0000000000..f27dd5f157 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/actual.js @@ -0,0 +1 @@ +function multiElementWithInitializer(...[a = 0, b, c = 1]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/expected.json new file mode 100644 index 0000000000..31e27ace56 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/expected.json @@ -0,0 +1,241 @@ +{ + "type": "File", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "multiElementWithInitializer" + }, + "name": "multiElementWithInitializer" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 37, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 40, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "elements": [ + { + "type": "AssignmentPattern", + "start": 41, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "left": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "NumericLiteral", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "Identifier", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 49 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "AssignmentPattern", + "start": 51, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "left": { + "type": "Identifier", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 52 + }, + "identifierName": "c" + }, + "name": "c" + }, + "right": { + "type": "NumericLiteral", + "start": 55, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 59, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/actual.js new file mode 100644 index 0000000000..b83b4bfe5c --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/actual.js @@ -0,0 +1 @@ +function multiElementWithLeading(x, y, ...[a, b, c]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/expected.json new file mode 100644 index 0000000000..d2f274ab0a --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/expected.json @@ -0,0 +1,205 @@ +{ + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "multiElementWithLeading" + }, + "name": "multiElementWithLeading" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "y" + }, + "name": "y" + }, + { + "type": "RestElement", + "start": 39, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 42, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 49, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 50 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 53, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/actual.js new file mode 100644 index 0000000000..e391769f7c --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/actual.js @@ -0,0 +1 @@ +function multiElementWithObject(...[{p: q}, {r}, {s = 0}]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/expected.json new file mode 100644 index 0000000000..1159886da3 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/expected.json @@ -0,0 +1,368 @@ +{ + "type": "File", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "multiElementWithObject" + }, + "name": "multiElementWithObject" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 32, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 35, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 37, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "p" + }, + "name": "p" + }, + "value": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "q" + }, + "name": "q" + } + } + ] + }, + { + "type": "ObjectPattern", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "r" + }, + "name": "r" + }, + "value": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "r" + }, + "name": "r" + }, + "extra": { + "shorthand": true + } + } + ] + }, + { + "type": "ObjectPattern", + "start": 49, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 50, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "s" + }, + "name": "s" + }, + "value": { + "type": "AssignmentPattern", + "start": 50, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "left": { + "type": "Identifier", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "s" + }, + "name": "s" + }, + "right": { + "type": "NumericLiteral", + "start": 54, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + "extra": { + "shorthand": true + } + } + ] + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 59, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/actual.js new file mode 100644 index 0000000000..b7700bbabe --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/actual.js @@ -0,0 +1 @@ +function multiElementWithRest(...[a, b, ...c]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/expected.json new file mode 100644 index 0000000000..a37e75f801 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/expected.json @@ -0,0 +1,186 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "multiElementWithRest" + }, + "name": "multiElementWithRest" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 30, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 33, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "RestElement", + "start": 40, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "argument": { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "c" + }, + "name": "c" + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 47, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-multi-element/actual.js new file mode 100644 index 0000000000..2b5c439f44 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element/actual.js @@ -0,0 +1 @@ +function multiElement(...[a, b, c]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-multi-element/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-multi-element/expected.json new file mode 100644 index 0000000000..86cdf203a2 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-multi-element/expected.json @@ -0,0 +1,171 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "multiElement" + }, + "name": "multiElement" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 25, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/actual.js new file mode 100644 index 0000000000..5a02b39faf --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/actual.js @@ -0,0 +1 @@ +function singleElementWithArray(...[[a]]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/expected.json new file mode 100644 index 0000000000..7184320ff8 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/expected.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "singleElementWithArray" + }, + "name": "singleElementWithArray" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 32, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 35, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/actual.js new file mode 100644 index 0000000000..4785727f45 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/actual.js @@ -0,0 +1 @@ +function singleElementWithInitializer(...[a = 0]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/expected.json new file mode 100644 index 0000000000..300640612a --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/expected.json @@ -0,0 +1,172 @@ +{ + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "singleElementWithInitializer" + }, + "name": "singleElementWithInitializer" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 38, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 41, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "elements": [ + { + "type": "AssignmentPattern", + "start": 42, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "left": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "NumericLiteral", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 50, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/actual.js new file mode 100644 index 0000000000..00bbf0a1cb --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/actual.js @@ -0,0 +1 @@ +function singleElementWithLeading(x, ...[a]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/expected.json new file mode 100644 index 0000000000..616bb91824 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/expected.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "singleElementWithLeading" + }, + "name": "singleElementWithLeading" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "RestElement", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 40, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/actual.js new file mode 100644 index 0000000000..257baf6299 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/actual.js @@ -0,0 +1 @@ +function singleElementWithObject(...[{p: q}]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/expected.json new file mode 100644 index 0000000000..2731def325 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/expected.json @@ -0,0 +1,189 @@ +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "singleElementWithObject" + }, + "name": "singleElementWithObject" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 33, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 36, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 38, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + }, + "identifierName": "p" + }, + "name": "p" + }, + "value": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "q" + }, + "name": "q" + } + } + ] + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 46, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/actual.js new file mode 100644 index 0000000000..fde87d8d10 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/actual.js @@ -0,0 +1 @@ +function singleElementWithRest(...[...a]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/expected.json new file mode 100644 index 0000000000..faed59b185 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/expected.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "singleElementWithRest" + }, + "name": "singleElementWithRest" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 31, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 34, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "elements": [ + { + "type": "RestElement", + "start": 35, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "argument": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element/actual.js b/test/fixtures/test262/rest-parameter/array-pattern-single-element/actual.js new file mode 100644 index 0000000000..945b43540d --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element/actual.js @@ -0,0 +1 @@ +function singleElement(...[a]) {} diff --git a/test/fixtures/test262/rest-parameter/array-pattern-single-element/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-single-element/expected.json new file mode 100644 index 0000000000..0416e8d857 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/array-pattern-single-element/expected.json @@ -0,0 +1,137 @@ +{ + "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": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "singleElement" + }, + "name": "singleElement" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/actual.js new file mode 100644 index 0000000000..93ea893190 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/actual.js @@ -0,0 +1 @@ +function emptyWithArray(...{p: []}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/expected.json new file mode 100644 index 0000000000..ce6d9fc36e --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/expected.json @@ -0,0 +1,171 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "emptyWithArray" + }, + "name": "emptyWithArray" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "p" + }, + "name": "p" + }, + "value": { + "type": "ArrayPattern", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "elements": [] + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/actual.js new file mode 100644 index 0000000000..0c8ec3596d --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/actual.js @@ -0,0 +1 @@ +function emptyWithLeading(x, ...{}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/expected.json new file mode 100644 index 0000000000..76ca5482f5 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/expected.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "emptyWithLeading" + }, + "name": "emptyWithLeading" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "RestElement", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "properties": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/actual.js new file mode 100644 index 0000000000..570a845e40 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/actual.js @@ -0,0 +1 @@ +function emptyWithObject(...{p: {}}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/expected.json new file mode 100644 index 0000000000..732c68014c --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/expected.json @@ -0,0 +1,171 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "emptyWithObject" + }, + "name": "emptyWithObject" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "p" + }, + "name": "p" + }, + "value": { + "type": "ObjectPattern", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "properties": [] + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-empty/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-empty/actual.js new file mode 100644 index 0000000000..35208e46a1 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-empty/actual.js @@ -0,0 +1 @@ +function empty(...{}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-empty/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-empty/expected.json new file mode 100644 index 0000000000..38447d9767 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-empty/expected.json @@ -0,0 +1,119 @@ +{ + "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": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "empty" + }, + "name": "empty" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "properties": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/actual.js new file mode 100644 index 0000000000..75b66ae975 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/actual.js @@ -0,0 +1 @@ +function multiElementWithArray(...{p: [a], b, q: [c]}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/expected.json new file mode 100644 index 0000000000..b455a94709 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/expected.json @@ -0,0 +1,313 @@ +{ + "type": "File", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "multiElementWithArray" + }, + "name": "multiElementWithArray" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 31, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 34, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 35, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "p" + }, + "name": "p" + }, + "value": { + "type": "ArrayPattern", + "start": 38, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 46, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "q" + }, + "name": "q" + }, + "value": { + "type": "ArrayPattern", + "start": 49, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "c" + }, + "name": "c" + } + ] + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 55, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/actual.js new file mode 100644 index 0000000000..55fdf3b9be --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/actual.js @@ -0,0 +1 @@ +function multiElementWithInitializer(...{a: r = 0, b: s, c: t = 1}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/expected.json new file mode 100644 index 0000000000..f497d59bd3 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/expected.json @@ -0,0 +1,346 @@ +{ + "type": "File", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "multiElementWithInitializer" + }, + "name": "multiElementWithInitializer" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 37, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 66 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 40, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 66 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 41, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "AssignmentPattern", + "start": 44, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "left": { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "r" + }, + "name": "r" + }, + "right": { + "type": "NumericLiteral", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + }, + { + "type": "ObjectProperty", + "start": 51, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 52 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 54, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 55 + }, + "identifierName": "s" + }, + "name": "s" + } + }, + { + "type": "ObjectProperty", + "start": 57, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 57, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 58 + }, + "identifierName": "c" + }, + "name": "c" + }, + "value": { + "type": "AssignmentPattern", + "start": 60, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 60 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "left": { + "type": "Identifier", + "start": 60, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 60 + }, + "end": { + "line": 1, + "column": 61 + }, + "identifierName": "t" + }, + "name": "t" + }, + "right": { + "type": "NumericLiteral", + "start": 64, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 64 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 68, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 68 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/actual.js new file mode 100644 index 0000000000..052c2356d3 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/actual.js @@ -0,0 +1 @@ +function multiElementWithLeading(x, y, ...{a: r, b: s, c: t}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/expected.json new file mode 100644 index 0000000000..52d43f0153 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/expected.json @@ -0,0 +1,310 @@ +{ + "type": "File", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "multiElementWithLeading" + }, + "name": "multiElementWithLeading" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "y" + }, + "name": "y" + }, + { + "type": "RestElement", + "start": 39, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 42, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 43, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "r" + }, + "name": "r" + } + }, + { + "type": "ObjectProperty", + "start": 49, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 49, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 50 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + }, + "identifierName": "s" + }, + "name": "s" + } + }, + { + "type": "ObjectProperty", + "start": 55, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 55, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 56 + }, + "identifierName": "c" + }, + "name": "c" + }, + "value": { + "type": "Identifier", + "start": 58, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 58 + }, + "end": { + "line": 1, + "column": 59 + }, + "identifierName": "t" + }, + "name": "t" + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 62, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 62 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/actual.js new file mode 100644 index 0000000000..cae2002644 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/actual.js @@ -0,0 +1 @@ +function multiElementWithObject(...{a: {p: q}, b: {r}, c: {s = 0}}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/expected.json new file mode 100644 index 0000000000..6c5d7cf14f --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/expected.json @@ -0,0 +1,473 @@ +{ + "type": "File", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "multiElementWithObject" + }, + "name": "multiElementWithObject" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 32, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 66 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 35, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 66 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 36, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "ObjectPattern", + "start": 39, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 40, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "p" + }, + "name": "p" + }, + "value": { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "q" + }, + "name": "q" + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 47, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 48 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "ObjectPattern", + "start": 50, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 52 + }, + "identifierName": "r" + }, + "name": "r" + }, + "value": { + "type": "Identifier", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 52 + }, + "identifierName": "r" + }, + "name": "r" + }, + "extra": { + "shorthand": true + } + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 55, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 55, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 56 + }, + "identifierName": "c" + }, + "name": "c" + }, + "value": { + "type": "ObjectPattern", + "start": 58, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 58 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 59, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "method": false, + "shorthand": true, + "computed": false, + "key": { + "type": "Identifier", + "start": 59, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 60 + }, + "identifierName": "s" + }, + "name": "s" + }, + "value": { + "type": "AssignmentPattern", + "start": 59, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "left": { + "type": "Identifier", + "start": 59, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 60 + }, + "identifierName": "s" + }, + "name": "s" + }, + "right": { + "type": "NumericLiteral", + "start": 63, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 63 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 68, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 68 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-multi-element/actual.js new file mode 100644 index 0000000000..2ea72fd00c --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element/actual.js @@ -0,0 +1 @@ +function multiElement(...{a: r, b: s, c: t}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-multi-element/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-multi-element/expected.json new file mode 100644 index 0000000000..b95a4b6234 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element/expected.json @@ -0,0 +1,276 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "multiElement" + }, + "name": "multiElement" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 22, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 25, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 26, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "r" + }, + "name": "r" + } + }, + { + "type": "ObjectProperty", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "b" + }, + "name": "b" + }, + "value": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "s" + }, + "name": "s" + } + }, + { + "type": "ObjectProperty", + "start": 38, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + }, + "identifierName": "c" + }, + "name": "c" + }, + "value": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "t" + }, + "name": "t" + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/actual.js new file mode 100644 index 0000000000..d448d7a728 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/actual.js @@ -0,0 +1 @@ +function singleElementWithArray(...{p: [a]}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/expected.json new file mode 100644 index 0000000000..e9c4c2859a --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/expected.json @@ -0,0 +1,189 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "singleElementWithArray" + }, + "name": "singleElementWithArray" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 35, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "p" + }, + "name": "p" + }, + "value": { + "type": "ArrayPattern", + "start": 39, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/actual.js new file mode 100644 index 0000000000..3417d7e1ee --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/actual.js @@ -0,0 +1 @@ +function singleElementWithInitializer(...{a: b = 0}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/expected.json new file mode 100644 index 0000000000..9faf97f761 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/expected.json @@ -0,0 +1,207 @@ +{ + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "singleElementWithInitializer" + }, + "name": "singleElementWithInitializer" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 38, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 41, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 42, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "AssignmentPattern", + "start": 45, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "left": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "b" + }, + "name": "b" + }, + "right": { + "type": "NumericLiteral", + "start": 49, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 53, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/actual.js new file mode 100644 index 0000000000..d69e8e13a4 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/actual.js @@ -0,0 +1 @@ +function singleElementWithLeading(x, ...{a: b}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/expected.json new file mode 100644 index 0000000000..dc7c07c735 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/expected.json @@ -0,0 +1,189 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "singleElementWithLeading" + }, + "name": "singleElementWithLeading" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "RestElement", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 40, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 41, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 48, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/actual.js new file mode 100644 index 0000000000..a7de007cfc --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/actual.js @@ -0,0 +1 @@ +function singleElementWithObject(...{p: {a: b}}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/expected.json new file mode 100644 index 0000000000..35be5a85ee --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/expected.json @@ -0,0 +1,224 @@ +{ + "type": "File", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "singleElementWithObject" + }, + "name": "singleElementWithObject" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 33, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 36, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "p" + }, + "name": "p" + }, + "value": { + "type": "ObjectPattern", + "start": 40, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 41, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ] + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 49, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element/actual.js b/test/fixtures/test262/rest-parameter/object-pattern-single-element/actual.js new file mode 100644 index 0000000000..aea7348b65 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element/actual.js @@ -0,0 +1 @@ +function singleElement(...{a: b}) {} diff --git a/test/fixtures/test262/rest-parameter/object-pattern-single-element/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-single-element/expected.json new file mode 100644 index 0000000000..f7e75584e0 --- /dev/null +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element/expected.json @@ -0,0 +1,172 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "singleElement" + }, + "name": "singleElement" + }, + "generator": false, + "expression": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 23, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 27, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "a" + }, + "name": "a" + }, + "value": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file From cbf420323767199aca4e60e62d2be31fbbee6126 Mon Sep 17 00:00:00 2001 From: Alex Rattray Date: Tue, 4 Apr 2017 06:47:59 -0700 Subject: [PATCH 071/105] Add extra.raw back to JSXText and JSXAttribute (#344) --- src/plugins/jsx/index.js | 9 +- test/fixtures/jsx/basic/11/expected.json | 5 +- test/fixtures/jsx/basic/12/expected.json | 5 +- test/fixtures/jsx/basic/13/expected.json | 11 +- test/fixtures/jsx/basic/18/expected.json | 5 +- test/fixtures/jsx/basic/19/expected.json | 10 +- test/fixtures/jsx/basic/21/expected.json | 5 +- test/fixtures/jsx/basic/3/expected.json | 15 +- test/fixtures/jsx/basic/4/expected.json | 15 +- test/fixtures/jsx/basic/7/expected.json | 10 +- test/fixtures/jsx/basic/entity/expected.json | 5 +- .../jsx/basic/nonentity-decimal/expected.json | 5 +- .../jsx/basic/nonentity/expected.json | 5 +- test/fixtures/jsx/regression/1/expected.json | 20 ++- test/fixtures/jsx/regression/4/expected.json | 5 +- test/fixtures/jsx/regression/6/expected.json | 5 +- test/fixtures/jsx/regression/7/expected.json | 5 +- .../jsx/regression/issue-2114/expected.json | 5 +- test/fixtures/jsx/regression/nbsp/actual.js | 1 + .../jsx/regression/nbsp/expected.json | 150 ++++++++++++++++++ 20 files changed, 259 insertions(+), 37 deletions(-) create mode 100644 test/fixtures/jsx/regression/nbsp/actual.js create mode 100644 test/fixtures/jsx/regression/nbsp/expected.json diff --git a/src/plugins/jsx/index.js b/src/plugins/jsx/index.js index c4e363ee35..49231318f4 100644 --- a/src/plugins/jsx/index.js +++ b/src/plugins/jsx/index.js @@ -247,9 +247,7 @@ pp.jsxParseAttributeValue = function() { case tt.jsxTagStart: case tt.string: - node = this.parseExprAtom(); - node.extra = null; - return node; + return this.parseExprAtom(); default: this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); @@ -401,10 +399,7 @@ export default function(instance) { instance.extend("parseExprAtom", function(inner) { return function(refShortHandDefaultPos) { if (this.match(tt.jsxText)) { - const node = this.parseLiteral(this.state.value, "JSXText"); - // https://github.com/babel/babel/issues/2078 - node.extra = null; - return node; + return this.parseLiteral(this.state.value, "JSXText"); } else if (this.match(tt.jsxTagStart)) { return this.jsxParseElement(); } else { diff --git a/test/fixtures/jsx/basic/11/expected.json b/test/fixtures/jsx/basic/11/expected.json index 28fdb031d2..04d9debf7f 100644 --- a/test/fixtures/jsx/basic/11/expected.json +++ b/test/fixtures/jsx/basic/11/expected.json @@ -135,7 +135,10 @@ "column": 18 } }, - "extra": null, + "extra": { + "rawValue": "@test content", + "raw": "@test content" + }, "value": "@test content" } ] diff --git a/test/fixtures/jsx/basic/12/expected.json b/test/fixtures/jsx/basic/12/expected.json index 6fd2dafebd..3dfab62bd7 100644 --- a/test/fixtures/jsx/basic/12/expected.json +++ b/test/fixtures/jsx/basic/12/expected.json @@ -185,7 +185,10 @@ "column": 35 } }, - "extra": null, + "extra": { + "rawValue": "7x invalid-js-identifier", + "raw": "7x invalid-js-identifier" + }, "value": "7x invalid-js-identifier" } ] diff --git a/test/fixtures/jsx/basic/13/expected.json b/test/fixtures/jsx/basic/13/expected.json index 33e3801372..63dd742439 100644 --- a/test/fixtures/jsx/basic/13/expected.json +++ b/test/fixtures/jsx/basic/13/expected.json @@ -149,8 +149,7 @@ "selfClosing": true }, "closingElement": null, - "children": [], - "extra": null + "children": [] } }, { @@ -276,11 +275,13 @@ "column": 50 } }, - "extra": null, + "extra": { + "rawValue": "monkeys /> gorillas", + "raw": "monkeys /> gorillas" + }, "value": "monkeys /> gorillas" } - ], - "extra": null + ] } } ], diff --git a/test/fixtures/jsx/basic/18/expected.json b/test/fixtures/jsx/basic/18/expected.json index ecbc6076b7..30be28155d 100644 --- a/test/fixtures/jsx/basic/18/expected.json +++ b/test/fixtures/jsx/basic/18/expected.json @@ -147,7 +147,10 @@ "column": 32 } }, - "extra": null, + "extra": { + "rawValue": "attribute", + "raw": "\"attribute\"" + }, "value": "attribute" } } diff --git a/test/fixtures/jsx/basic/19/expected.json b/test/fixtures/jsx/basic/19/expected.json index e18fa97fd0..eb742ee767 100644 --- a/test/fixtures/jsx/basic/19/expected.json +++ b/test/fixtures/jsx/basic/19/expected.json @@ -115,7 +115,10 @@ "column": 18 } }, - "extra": null, + "extra": { + "rawValue": "leading", + "raw": "\"leading\"" + }, "value": "leading" } }, @@ -163,7 +166,10 @@ "column": 35 } }, - "extra": null, + "extra": { + "rawValue": "attribute", + "raw": "\"attribute\"" + }, "value": "attribute" } }, diff --git a/test/fixtures/jsx/basic/21/expected.json b/test/fixtures/jsx/basic/21/expected.json index 25fba8ed09..2fa06f64c8 100644 --- a/test/fixtures/jsx/basic/21/expected.json +++ b/test/fixtures/jsx/basic/21/expected.json @@ -168,7 +168,10 @@ "column": 13 } }, - "extra": null, + "extra": { + "rawValue": " ", + "raw": " " + }, "value": " " }, { diff --git a/test/fixtures/jsx/basic/3/expected.json b/test/fixtures/jsx/basic/3/expected.json index 7fef3da7b3..e1b54a6b01 100644 --- a/test/fixtures/jsx/basic/3/expected.json +++ b/test/fixtures/jsx/basic/3/expected.json @@ -146,7 +146,10 @@ "column": 14 } }, - "extra": null, + "extra": { + "rawValue": "bar", + "raw": "\"bar\"" + }, "value": "bar" } } @@ -215,7 +218,10 @@ "column": 16 } }, - "extra": null, + "extra": { + "rawValue": " ", + "raw": " " + }, "value": " " }, { @@ -264,7 +270,10 @@ "column": 24 } }, - "extra": null, + "extra": { + "rawValue": " ", + "raw": " " + }, "value": " " }, { diff --git a/test/fixtures/jsx/basic/4/expected.json b/test/fixtures/jsx/basic/4/expected.json index 1c24bbb736..f0f895006b 100644 --- a/test/fixtures/jsx/basic/4/expected.json +++ b/test/fixtures/jsx/basic/4/expected.json @@ -181,7 +181,10 @@ "column": 16 } }, - "extra": null, + "extra": { + "rawValue": " ", + "raw": "\" \"" + }, "value": " " } }, @@ -229,7 +232,10 @@ "column": 26 } }, - "extra": null, + "extra": { + "rawValue": "&", + "raw": "\"&\"" + }, "value": "&" } }, @@ -277,7 +283,10 @@ "column": 37 } }, - "extra": null, + "extra": { + "rawValue": "&r;", + "raw": "\"&r;\"" + }, "value": "&r;" } } diff --git a/test/fixtures/jsx/basic/7/expected.json b/test/fixtures/jsx/basic/7/expected.json index 154626c2da..95d6016840 100644 --- a/test/fixtures/jsx/basic/7/expected.json +++ b/test/fixtures/jsx/basic/7/expected.json @@ -115,7 +115,10 @@ "column": 22 } }, - "extra": null, + "extra": { + "rawValue": "&&", + "raw": "\"&&\"" + }, "value": "&&" } } @@ -184,7 +187,10 @@ "column": 0 } }, - "extra": null, + "extra": { + "rawValue": "\nbar\nbaz\n", + "raw": "\nbar\nbaz\n" + }, "value": "\nbar\nbaz\n" } ] diff --git a/test/fixtures/jsx/basic/entity/expected.json b/test/fixtures/jsx/basic/entity/expected.json index 69f4b59ea6..e95455df4c 100644 --- a/test/fixtures/jsx/basic/entity/expected.json +++ b/test/fixtures/jsx/basic/entity/expected.json @@ -135,7 +135,10 @@ "column": 12 } }, - "extra": null, + "extra": { + "rawValue": "💩", + "raw": "💩" + }, "value": "💩" } ] diff --git a/test/fixtures/jsx/basic/nonentity-decimal/expected.json b/test/fixtures/jsx/basic/nonentity-decimal/expected.json index 8ddb29c276..50a5f67c5a 100644 --- a/test/fixtures/jsx/basic/nonentity-decimal/expected.json +++ b/test/fixtures/jsx/basic/nonentity-decimal/expected.json @@ -135,7 +135,10 @@ "column": 11 } }, - "extra": null, + "extra": { + "rawValue": "f4a9;", + "raw": "f4a9;" + }, "value": "f4a9;" } ] diff --git a/test/fixtures/jsx/basic/nonentity/expected.json b/test/fixtures/jsx/basic/nonentity/expected.json index 7d91ec929e..9b6cf134af 100644 --- a/test/fixtures/jsx/basic/nonentity/expected.json +++ b/test/fixtures/jsx/basic/nonentity/expected.json @@ -135,7 +135,10 @@ "column": 12 } }, - "extra": null, + "extra": { + "rawValue": "g4q9;", + "raw": "g4q9;" + }, "value": "g4q9;" } ] diff --git a/test/fixtures/jsx/regression/1/expected.json b/test/fixtures/jsx/regression/1/expected.json index 568a15f9e9..aadc50ad85 100644 --- a/test/fixtures/jsx/regression/1/expected.json +++ b/test/fixtures/jsx/regression/1/expected.json @@ -135,7 +135,10 @@ "column": 7 } }, - "extra": null, + "extra": { + "rawValue": "foo ", + "raw": "foo " + }, "value": "foo " }, { @@ -211,7 +214,10 @@ "column": 21 } }, - "extra": null, + "extra": { + "rawValue": "test", + "raw": "\"test\"" + }, "value": "test" } } @@ -280,7 +286,10 @@ "column": 26 } }, - "extra": null, + "extra": { + "rawValue": " bar", + "raw": " bar" + }, "value": " bar" } ] @@ -299,7 +308,10 @@ "column": 34 } }, - "extra": null, + "extra": { + "rawValue": " baz", + "raw": " baz" + }, "value": " baz" } ] diff --git a/test/fixtures/jsx/regression/4/expected.json b/test/fixtures/jsx/regression/4/expected.json index 6e86caee9b..4479b6debd 100644 --- a/test/fixtures/jsx/regression/4/expected.json +++ b/test/fixtures/jsx/regression/4/expected.json @@ -135,7 +135,10 @@ "column": 10 } }, - "extra": null, + "extra": { + "rawValue": "/text", + "raw": "/text" + }, "value": "/text" } ] diff --git a/test/fixtures/jsx/regression/6/expected.json b/test/fixtures/jsx/regression/6/expected.json index fbfd450b91..acd021ff39 100644 --- a/test/fixtures/jsx/regression/6/expected.json +++ b/test/fixtures/jsx/regression/6/expected.json @@ -115,7 +115,10 @@ "column": 18 } }, - "extra": null, + "extra": { + "rawValue": "leading", + "raw": "\"leading\"" + }, "value": "leading" } }, diff --git a/test/fixtures/jsx/regression/7/expected.json b/test/fixtures/jsx/regression/7/expected.json index d82ea9606a..fc8f6720e2 100644 --- a/test/fixtures/jsx/regression/7/expected.json +++ b/test/fixtures/jsx/regression/7/expected.json @@ -115,7 +115,10 @@ "column": 15 } }, - "extra": null, + "extra": { + "rawValue": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z", + "raw": "\"M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z\"" + }, "value": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z" } } diff --git a/test/fixtures/jsx/regression/issue-2114/expected.json b/test/fixtures/jsx/regression/issue-2114/expected.json index 15b1d87259..6abcb37004 100644 --- a/test/fixtures/jsx/regression/issue-2114/expected.json +++ b/test/fixtures/jsx/regression/issue-2114/expected.json @@ -115,7 +115,10 @@ "column": 43 } }, - "extra": null, + "extra": { + "rawValue": "^([\\w\\.\\-]+\\s)*[\\w\\.\\-]+\\s?$", + "raw": "\"^([\\w\\.\\-]+\\s)*[\\w\\.\\-]+\\s?$\"" + }, "value": "^([\\w\\.\\-]+\\s)*[\\w\\.\\-]+\\s?$" } } diff --git a/test/fixtures/jsx/regression/nbsp/actual.js b/test/fixtures/jsx/regression/nbsp/actual.js new file mode 100644 index 0000000000..e6b2eb47be --- /dev/null +++ b/test/fixtures/jsx/regression/nbsp/actual.js @@ -0,0 +1 @@ +
 
diff --git a/test/fixtures/jsx/regression/nbsp/expected.json b/test/fixtures/jsx/regression/nbsp/expected.json new file mode 100644 index 0000000000..32e90c742f --- /dev/null +++ b/test/fixtures/jsx/regression/nbsp/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "JSXElement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": " ", + "raw": " " + }, + "value": " " + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file From bdfa92464b111cee610052fd80b767491dc190f7 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Tue, 4 Apr 2017 08:48:50 -0500 Subject: [PATCH 072/105] Fix predicate attachment to match flow parser (#428) --- src/plugins/flow.js | 31 +++--- .../good_03/expected.json | 4 +- .../good_04/expected.json | 4 +- .../good_05/expected.json | 4 +- .../good_01/expected.json | 6 +- .../good_10/expected.json | 4 +- .../good_11/expected.json | 4 +- .../good_12/expected.json | 4 +- .../good_13/expected.json | 4 +- .../good_14/expected.json | 4 +- .../flow/declare-module/4/expected.json | 6 +- .../flow/declare-statements/3/expected.json | 6 +- .../flow/declare-statements/4/expected.json | 6 +- .../flow/declare-statements/5/expected.json | 6 +- .../flow/declare-statements/6/expected.json | 6 +- .../literal-types/string-double/expected.json | 4 +- .../literal-types/string-single/expected.json | 4 +- test/fixtures/flow/predicates/1/expected.json | 104 +++++++++--------- test/fixtures/flow/predicates/2/expected.json | 25 +---- test/fixtures/flow/predicates/3/expected.json | 25 +---- test/fixtures/flow/predicates/6/expected.json | 6 +- .../flow/regression/issue-2493/expected.json | 4 +- .../1/expected.json | 4 +- .../flow/type-annotations/100/expected.json | 4 +- .../flow/type-annotations/101/expected.json | 4 +- .../flow/type-annotations/102/expected.json | 4 +- .../flow/type-annotations/103/expected.json | 4 +- .../flow/type-annotations/12/expected.json | 4 +- .../flow/type-annotations/13/expected.json | 4 +- .../flow/type-annotations/130/expected.json | 4 +- .../flow/type-annotations/14/expected.json | 4 +- .../flow/type-annotations/15/expected.json | 4 +- .../flow/type-annotations/16/expected.json | 4 +- .../flow/type-annotations/21/expected.json | 4 +- .../flow/type-annotations/22/expected.json | 4 +- .../flow/type-annotations/23/expected.json | 4 +- .../flow/type-annotations/24/expected.json | 4 +- .../flow/type-annotations/25/expected.json | 4 +- .../flow/type-annotations/26/expected.json | 4 +- .../flow/type-annotations/28/expected.json | 4 +- .../flow/type-annotations/29/expected.json | 4 +- .../flow/type-annotations/50/expected.json | 4 +- .../flow/type-annotations/67/expected.json | 4 +- .../flow/type-annotations/68/expected.json | 4 +- .../flow/type-annotations/72/expected.json | 4 +- .../flow/type-annotations/73/expected.json | 4 +- .../flow/type-annotations/74/expected.json | 4 +- .../flow/type-annotations/79/expected.json | 4 +- .../flow/type-annotations/99/expected.json | 4 +- .../arrow-func-return-newline/expected.json | 4 +- .../existential-type-param-2/expected.json | 4 +- 51 files changed, 181 insertions(+), 206 deletions(-) diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 070b512e00..faeec9d006 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -40,7 +40,7 @@ pp.flowParsePredicate = function() { this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here."); } if (this.eat(tt.parenL)) { - node.expression = this.parseExpression(); + node.value = this.parseExpression(); this.expect(tt.parenR); return this.finishNode(node, "DeclaredPredicate"); } else { @@ -92,10 +92,10 @@ pp.flowParseDeclareFunction = function (node) { typeNode.params = tmp.params; typeNode.rest = tmp.rest; this.expect(tt.parenR); - let predicate = null; - [typeNode.returnType, predicate] = this.flowParseTypeAndPredicateInitialiser(); + + [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); - typeContainer.predicate = predicate; + id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); this.finishNode(id, id.type); @@ -836,12 +836,6 @@ pp.flowParseTypeAnnotation = function () { return this.finishNode(node, "TypeAnnotation"); }; -pp.flowParseTypeAndPredicateAnnotation = function () { - const node = this.startNode(); - [node.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - return this.finishNode(node, "TypeAnnotation"); -}; - pp.flowParseTypeAnnotatableIdentifier = function () { const ident = this.flowParseRestrictedIdentifier(); if (this.match(tt.colon)) { @@ -884,7 +878,12 @@ export default function (instance) { if (this.match(tt.colon) && !allowExpression) { // if allowExpression is true then we're parsing an arrow function and if // there's a return type then it's been handled elsewhere - node.returnType = this.flowParseTypeAndPredicateAnnotation(); + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + + node.returnType = typeNode.typeAnnotation + ? this.finishNode(typeNode, "TypeAnnotation") + : null; } return inner.call(this, node, allowExpression); @@ -1437,13 +1436,19 @@ export default function (instance) { try { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; - const returnType = this.flowParseTypeAndPredicateAnnotation(); + + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; if (this.canInsertSemicolon()) this.unexpected(); if (!this.match(tt.arrow)) this.unexpected(); + // assign after it is clear it is an arrow - node.returnType = returnType; + node.returnType = typeNode.typeAnnotation + ? this.finishNode(typeNode, "TypeAnnotation") + : null; } catch (err) { if (err instanceof SyntaxError) { this.state = state; diff --git a/test/fixtures/flow/anonymous-function-no-parens-types/good_03/expected.json b/test/fixtures/flow/anonymous-function-no-parens-types/good_03/expected.json index 15898b8a3f..ce0e1324e4 100644 --- a/test/fixtures/flow/anonymous-function-no-parens-types/good_03/expected.json +++ b/test/fixtures/flow/anonymous-function-no-parens-types/good_03/expected.json @@ -88,6 +88,7 @@ "column": 25 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 10, @@ -116,8 +117,7 @@ "column": 18 } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-no-parens-types/good_04/expected.json b/test/fixtures/flow/anonymous-function-no-parens-types/good_04/expected.json index 4826089df7..2baac05e21 100644 --- a/test/fixtures/flow/anonymous-function-no-parens-types/good_04/expected.json +++ b/test/fixtures/flow/anonymous-function-no-parens-types/good_04/expected.json @@ -88,6 +88,7 @@ "column": 34 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 10, @@ -148,8 +149,7 @@ } } ] - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json b/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json index 4aac5e5b7b..27e2f2a7b9 100644 --- a/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json +++ b/test/fixtures/flow/anonymous-function-no-parens-types/good_05/expected.json @@ -88,6 +88,7 @@ "column": 35 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 11, @@ -184,8 +185,7 @@ "value": 123 }, "typeParameters": null - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-types/good_01/expected.json b/test/fixtures/flow/anonymous-function-types/good_01/expected.json index f81ca57295..70c0c695b0 100644 --- a/test/fixtures/flow/anonymous-function-types/good_01/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_01/expected.json @@ -185,10 +185,10 @@ } } } - }, - "predicate": null + } } - } + }, + "predicate": null } ], "directives": [] diff --git a/test/fixtures/flow/anonymous-function-types/good_10/expected.json b/test/fixtures/flow/anonymous-function-types/good_10/expected.json index 6f6b8d5c5f..acd3af9b78 100644 --- a/test/fixtures/flow/anonymous-function-types/good_10/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_10/expected.json @@ -88,6 +88,7 @@ "column": 38 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 11, @@ -188,8 +189,7 @@ "value": 123 }, "typeParameters": null - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-types/good_11/expected.json b/test/fixtures/flow/anonymous-function-types/good_11/expected.json index f4bff8d5de..794fbace18 100644 --- a/test/fixtures/flow/anonymous-function-types/good_11/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_11/expected.json @@ -88,6 +88,7 @@ "column": 27 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 10, @@ -116,8 +117,7 @@ "column": 19 } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-types/good_12/expected.json b/test/fixtures/flow/anonymous-function-types/good_12/expected.json index 862a858093..c70e9e0bae 100644 --- a/test/fixtures/flow/anonymous-function-types/good_12/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_12/expected.json @@ -88,6 +88,7 @@ "column": 36 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 10, @@ -148,8 +149,7 @@ } } ] - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-types/good_13/expected.json b/test/fixtures/flow/anonymous-function-types/good_13/expected.json index ea21215b6a..6f7739e278 100644 --- a/test/fixtures/flow/anonymous-function-types/good_13/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_13/expected.json @@ -88,6 +88,7 @@ "column": 37 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 11, @@ -178,8 +179,7 @@ "value": 123 }, "typeParameters": null - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/anonymous-function-types/good_14/expected.json b/test/fixtures/flow/anonymous-function-types/good_14/expected.json index d61b3e631d..1844409016 100644 --- a/test/fixtures/flow/anonymous-function-types/good_14/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_14/expected.json @@ -88,6 +88,7 @@ "column": 25 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 11, @@ -158,8 +159,7 @@ "value": 2 } ] - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/declare-module/4/expected.json b/test/fixtures/flow/declare-module/4/expected.json index 89bdb1f60c..a22533aca2 100644 --- a/test/fixtures/flow/declare-module/4/expected.json +++ b/test/fixtures/flow/declare-module/4/expected.json @@ -150,10 +150,10 @@ } } } - }, - "predicate": null + } } - } + }, + "predicate": null } ] } diff --git a/test/fixtures/flow/declare-statements/3/expected.json b/test/fixtures/flow/declare-statements/3/expected.json index ff4d67ffd4..b85ed89a5b 100644 --- a/test/fixtures/flow/declare-statements/3/expected.json +++ b/test/fixtures/flow/declare-statements/3/expected.json @@ -104,10 +104,10 @@ } } } - }, - "predicate": null + } } - } + }, + "predicate": null } ], "directives": [] diff --git a/test/fixtures/flow/declare-statements/4/expected.json b/test/fixtures/flow/declare-statements/4/expected.json index a5c4e3c553..3551a556fe 100644 --- a/test/fixtures/flow/declare-statements/4/expected.json +++ b/test/fixtures/flow/declare-statements/4/expected.json @@ -104,10 +104,10 @@ } } } - }, - "predicate": null + } } - } + }, + "predicate": null } ], "directives": [] diff --git a/test/fixtures/flow/declare-statements/5/expected.json b/test/fixtures/flow/declare-statements/5/expected.json index b93e58be9b..3670040e1d 100644 --- a/test/fixtures/flow/declare-statements/5/expected.json +++ b/test/fixtures/flow/declare-statements/5/expected.json @@ -137,10 +137,10 @@ } } } - }, - "predicate": null + } } - } + }, + "predicate": null } ], "directives": [] diff --git a/test/fixtures/flow/declare-statements/6/expected.json b/test/fixtures/flow/declare-statements/6/expected.json index 8c803e35a3..443d802910 100644 --- a/test/fixtures/flow/declare-statements/6/expected.json +++ b/test/fixtures/flow/declare-statements/6/expected.json @@ -201,10 +201,10 @@ } } } - }, - "predicate": null + } } - } + }, + "predicate": null } ], "directives": [] diff --git a/test/fixtures/flow/literal-types/string-double/expected.json b/test/fixtures/flow/literal-types/string-double/expected.json index 7ced64b71c..97893a5689 100644 --- a/test/fixtures/flow/literal-types/string-double/expected.json +++ b/test/fixtures/flow/literal-types/string-double/expected.json @@ -162,9 +162,9 @@ }, "name": "HTMLDivElement" } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 55, diff --git a/test/fixtures/flow/literal-types/string-single/expected.json b/test/fixtures/flow/literal-types/string-single/expected.json index c968bebd4b..bbdf5f7e6c 100644 --- a/test/fixtures/flow/literal-types/string-single/expected.json +++ b/test/fixtures/flow/literal-types/string-single/expected.json @@ -162,9 +162,9 @@ }, "name": "HTMLDivElement" } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 55, diff --git a/test/fixtures/flow/predicates/1/expected.json b/test/fixtures/flow/predicates/1/expected.json index 0c21887783..6412f802f5 100644 --- a/test/fixtures/flow/predicates/1/expected.json +++ b/test/fixtures/flow/predicates/1/expected.json @@ -153,67 +153,67 @@ } } } + } + } + }, + "predicate": { + "type": "DeclaredPredicate", + "start": 40, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 40 }, - "predicate": { - "type": "DeclaredPredicate", - "start": 40, - "end": 59, + "end": { + "line": 1, + "column": 59 + } + }, + "value": { + "type": "BinaryExpression", + "start": 48, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "left": { + "type": "Identifier", + "start": 48, + "end": 49, "loc": { "start": { "line": 1, - "column": 40 + "column": 48 }, "end": { "line": 1, - "column": 59 - } - }, - "expression": { - "type": "BinaryExpression", - "start": 48, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 58 - } + "column": 49 }, - "left": { - "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 49 - }, - "identifierName": "x" - }, - "name": "x" + "identifierName": "x" + }, + "name": "x" + }, + "operator": "!==", + "right": { + "type": "NullLiteral", + "start": 54, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 54 }, - "operator": "!==", - "right": { - "type": "NullLiteral", - "start": 54, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 58 - } - } + "end": { + "line": 1, + "column": 58 } } } diff --git a/test/fixtures/flow/predicates/2/expected.json b/test/fixtures/flow/predicates/2/expected.json index fb45d0dad1..79772c2417 100644 --- a/test/fixtures/flow/predicates/2/expected.json +++ b/test/fixtures/flow/predicates/2/expected.json @@ -88,37 +88,22 @@ "column": 52 } }, - "returnType": { - "type": "TypeAnnotation", - "start": 18, + "predicate": { + "type": "InferredPredicate", + "start": 20, "end": 27, "loc": { "start": { "line": 1, - "column": 18 + "column": 20 }, "end": { "line": 1, "column": 27 } - }, - "typeAnnotation": null, - "predicate": { - "type": "InferredPredicate", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } } }, + "returnType": null, "id": null, "generator": false, "expression": true, diff --git a/test/fixtures/flow/predicates/3/expected.json b/test/fixtures/flow/predicates/3/expected.json index 8bdfbef015..85e6105aca 100644 --- a/test/fixtures/flow/predicates/3/expected.json +++ b/test/fixtures/flow/predicates/3/expected.json @@ -111,37 +111,22 @@ } } ], - "returnType": { - "type": "TypeAnnotation", - "start": 22, + "predicate": { + "type": "InferredPredicate", + "start": 24, "end": 31, "loc": { "start": { "line": 1, - "column": 22 + "column": 24 }, "end": { "line": 1, "column": 31 } - }, - "typeAnnotation": null, - "predicate": { - "type": "InferredPredicate", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - } } }, + "returnType": null, "body": { "type": "BlockStatement", "start": 32, diff --git a/test/fixtures/flow/predicates/6/expected.json b/test/fixtures/flow/predicates/6/expected.json index 2916a3cf54..d0c50d9555 100644 --- a/test/fixtures/flow/predicates/6/expected.json +++ b/test/fixtures/flow/predicates/6/expected.json @@ -589,10 +589,10 @@ "name": "Array" } } - }, - "predicate": null + } } - } + }, + "predicate": null } ], "directives": [] diff --git a/test/fixtures/flow/regression/issue-2493/expected.json b/test/fixtures/flow/regression/issue-2493/expected.json index 412bb96edd..9e890e3ca3 100644 --- a/test/fixtures/flow/regression/issue-2493/expected.json +++ b/test/fixtures/flow/regression/issue-2493/expected.json @@ -88,6 +88,7 @@ "column": 1 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 41, @@ -116,8 +117,7 @@ "column": 49 } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/trailing-function-commas-type/1/expected.json b/test/fixtures/flow/trailing-function-commas-type/1/expected.json index 765744fb3f..806ebcd4b7 100644 --- a/test/fixtures/flow/trailing-function-commas-type/1/expected.json +++ b/test/fixtures/flow/trailing-function-commas-type/1/expected.json @@ -56,6 +56,7 @@ "column": 42 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 21, @@ -102,8 +103,7 @@ }, "name": "ReturnType" } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/100/expected.json b/test/fixtures/flow/type-annotations/100/expected.json index 41ea4f70df..dee215f26f 100644 --- a/test/fixtures/flow/type-annotations/100/expected.json +++ b/test/fixtures/flow/type-annotations/100/expected.json @@ -143,9 +143,9 @@ } }, "value": true - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 23, diff --git a/test/fixtures/flow/type-annotations/101/expected.json b/test/fixtures/flow/type-annotations/101/expected.json index dd76a3f6b4..aaf4345455 100644 --- a/test/fixtures/flow/type-annotations/101/expected.json +++ b/test/fixtures/flow/type-annotations/101/expected.json @@ -56,6 +56,7 @@ "column": 45 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 23, @@ -117,8 +118,7 @@ "name": "ReturnType" } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/102/expected.json b/test/fixtures/flow/type-annotations/102/expected.json index c03c26b03d..e48ab5b500 100644 --- a/test/fixtures/flow/type-annotations/102/expected.json +++ b/test/fixtures/flow/type-annotations/102/expected.json @@ -56,6 +56,7 @@ "column": 50 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 29, @@ -133,8 +134,7 @@ }, "name": "Array" } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/103/expected.json b/test/fixtures/flow/type-annotations/103/expected.json index 9824789642..fd5baadca1 100644 --- a/test/fixtures/flow/type-annotations/103/expected.json +++ b/test/fixtures/flow/type-annotations/103/expected.json @@ -88,6 +88,7 @@ "column": 73 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 65, @@ -134,8 +135,7 @@ }, "name": "a" } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/12/expected.json b/test/fixtures/flow/type-annotations/12/expected.json index 9b0105cae1..8643321a36 100644 --- a/test/fixtures/flow/type-annotations/12/expected.json +++ b/test/fixtures/flow/type-annotations/12/expected.json @@ -91,9 +91,9 @@ "column": 21 } } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 21, diff --git a/test/fixtures/flow/type-annotations/13/expected.json b/test/fixtures/flow/type-annotations/13/expected.json index 4e216e438a..79007cd2cd 100644 --- a/test/fixtures/flow/type-annotations/13/expected.json +++ b/test/fixtures/flow/type-annotations/13/expected.json @@ -109,9 +109,9 @@ } }, "typeParameters": null - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 25, diff --git a/test/fixtures/flow/type-annotations/130/expected.json b/test/fixtures/flow/type-annotations/130/expected.json index 04fcde6a9b..8fd8731f5c 100644 --- a/test/fixtures/flow/type-annotations/130/expected.json +++ b/test/fixtures/flow/type-annotations/130/expected.json @@ -270,9 +270,9 @@ "column": 42 } } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 43, diff --git a/test/fixtures/flow/type-annotations/14/expected.json b/test/fixtures/flow/type-annotations/14/expected.json index df8525c0d6..9368eb0561 100644 --- a/test/fixtures/flow/type-annotations/14/expected.json +++ b/test/fixtures/flow/type-annotations/14/expected.json @@ -158,9 +158,9 @@ } }, "typeParameters": null - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 33, diff --git a/test/fixtures/flow/type-annotations/15/expected.json b/test/fixtures/flow/type-annotations/15/expected.json index a6da914974..3e0cbfc4ee 100644 --- a/test/fixtures/flow/type-annotations/15/expected.json +++ b/test/fixtures/flow/type-annotations/15/expected.json @@ -158,9 +158,9 @@ } }, "typeParameters": null - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 34, diff --git a/test/fixtures/flow/type-annotations/16/expected.json b/test/fixtures/flow/type-annotations/16/expected.json index 3f39468f6a..16a7f500d7 100644 --- a/test/fixtures/flow/type-annotations/16/expected.json +++ b/test/fixtures/flow/type-annotations/16/expected.json @@ -95,9 +95,9 @@ "properties": [], "indexers": [], "exact": false - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 19, diff --git a/test/fixtures/flow/type-annotations/21/expected.json b/test/fixtures/flow/type-annotations/21/expected.json index 9a7b0f628b..11ac28aa29 100644 --- a/test/fixtures/flow/type-annotations/21/expected.json +++ b/test/fixtures/flow/type-annotations/21/expected.json @@ -206,9 +206,9 @@ "column": 33 } } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 33, diff --git a/test/fixtures/flow/type-annotations/22/expected.json b/test/fixtures/flow/type-annotations/22/expected.json index f851043cf5..7e408c0077 100644 --- a/test/fixtures/flow/type-annotations/22/expected.json +++ b/test/fixtures/flow/type-annotations/22/expected.json @@ -158,9 +158,9 @@ "column": 23 } } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 23, diff --git a/test/fixtures/flow/type-annotations/23/expected.json b/test/fixtures/flow/type-annotations/23/expected.json index 26289cb8bf..a0d584a412 100644 --- a/test/fixtures/flow/type-annotations/23/expected.json +++ b/test/fixtures/flow/type-annotations/23/expected.json @@ -241,9 +241,9 @@ }, "name": "T" } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 18, diff --git a/test/fixtures/flow/type-annotations/24/expected.json b/test/fixtures/flow/type-annotations/24/expected.json index cb9a6c5fbc..bef2f718ee 100644 --- a/test/fixtures/flow/type-annotations/24/expected.json +++ b/test/fixtures/flow/type-annotations/24/expected.json @@ -241,9 +241,9 @@ }, "name": "T" } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 19, diff --git a/test/fixtures/flow/type-annotations/25/expected.json b/test/fixtures/flow/type-annotations/25/expected.json index b5e58e017c..17b2ed9260 100644 --- a/test/fixtures/flow/type-annotations/25/expected.json +++ b/test/fixtures/flow/type-annotations/25/expected.json @@ -241,9 +241,9 @@ }, "name": "T" } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 24, diff --git a/test/fixtures/flow/type-annotations/26/expected.json b/test/fixtures/flow/type-annotations/26/expected.json index e2c02a54a5..3a317643db 100644 --- a/test/fixtures/flow/type-annotations/26/expected.json +++ b/test/fixtures/flow/type-annotations/26/expected.json @@ -244,9 +244,9 @@ }, "name": "T" } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 19, diff --git a/test/fixtures/flow/type-annotations/28/expected.json b/test/fixtures/flow/type-annotations/28/expected.json index b5c04ffc8d..c67f48e7ca 100644 --- a/test/fixtures/flow/type-annotations/28/expected.json +++ b/test/fixtures/flow/type-annotations/28/expected.json @@ -190,9 +190,9 @@ "column": 41 } } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 41, diff --git a/test/fixtures/flow/type-annotations/29/expected.json b/test/fixtures/flow/type-annotations/29/expected.json index 1f35974d10..47b047f5d5 100644 --- a/test/fixtures/flow/type-annotations/29/expected.json +++ b/test/fixtures/flow/type-annotations/29/expected.json @@ -142,9 +142,9 @@ "column": 31 } } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 31, diff --git a/test/fixtures/flow/type-annotations/50/expected.json b/test/fixtures/flow/type-annotations/50/expected.json index ded300b573..8ca1334648 100644 --- a/test/fixtures/flow/type-annotations/50/expected.json +++ b/test/fixtures/flow/type-annotations/50/expected.json @@ -210,9 +210,9 @@ "column": 30 } } - }, - "predicate": null + } }, + "predicate": null, "body": { "type": "BlockStatement", "start": 31, diff --git a/test/fixtures/flow/type-annotations/67/expected.json b/test/fixtures/flow/type-annotations/67/expected.json index 3e63de0f6d..5d9f3d2448 100644 --- a/test/fixtures/flow/type-annotations/67/expected.json +++ b/test/fixtures/flow/type-annotations/67/expected.json @@ -88,6 +88,7 @@ "column": 27 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 12, @@ -116,8 +117,7 @@ "column": 20 } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/68/expected.json b/test/fixtures/flow/type-annotations/68/expected.json index 9e256a6a4d..68c74a61bf 100644 --- a/test/fixtures/flow/type-annotations/68/expected.json +++ b/test/fixtures/flow/type-annotations/68/expected.json @@ -88,6 +88,7 @@ "column": 30 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 15, @@ -116,8 +117,7 @@ "column": 23 } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/72/expected.json b/test/fixtures/flow/type-annotations/72/expected.json index c13a951af4..c43076a1e5 100644 --- a/test/fixtures/flow/type-annotations/72/expected.json +++ b/test/fixtures/flow/type-annotations/72/expected.json @@ -88,6 +88,7 @@ "column": 28 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 13, @@ -116,8 +117,7 @@ "column": 21 } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/73/expected.json b/test/fixtures/flow/type-annotations/73/expected.json index a1b6cfa22b..84c65077ec 100644 --- a/test/fixtures/flow/type-annotations/73/expected.json +++ b/test/fixtures/flow/type-annotations/73/expected.json @@ -88,6 +88,7 @@ "column": 31 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 16, @@ -116,8 +117,7 @@ "column": 24 } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/74/expected.json b/test/fixtures/flow/type-annotations/74/expected.json index 4d9adf8da2..a3fcb6dbeb 100644 --- a/test/fixtures/flow/type-annotations/74/expected.json +++ b/test/fixtures/flow/type-annotations/74/expected.json @@ -102,6 +102,7 @@ "column": 32 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 17, @@ -130,8 +131,7 @@ "column": 25 } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/79/expected.json b/test/fixtures/flow/type-annotations/79/expected.json index 6975ffcfda..eac4bddf31 100644 --- a/test/fixtures/flow/type-annotations/79/expected.json +++ b/test/fixtures/flow/type-annotations/79/expected.json @@ -119,6 +119,7 @@ "column": 36 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 22, @@ -147,8 +148,7 @@ "column": 30 } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/99/expected.json b/test/fixtures/flow/type-annotations/99/expected.json index 90620eca01..ed05f4b8f0 100644 --- a/test/fixtures/flow/type-annotations/99/expected.json +++ b/test/fixtures/flow/type-annotations/99/expected.json @@ -56,6 +56,7 @@ "column": 21 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 10, @@ -102,8 +103,7 @@ }, "name": "z" } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/arrow-func-return-newline/expected.json b/test/fixtures/flow/type-annotations/arrow-func-return-newline/expected.json index 5ed4f9d38d..10e6b1850a 100644 --- a/test/fixtures/flow/type-annotations/arrow-func-return-newline/expected.json +++ b/test/fixtures/flow/type-annotations/arrow-func-return-newline/expected.json @@ -88,6 +88,7 @@ "column": 14 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 24, @@ -116,8 +117,7 @@ "column": 8 } } - }, - "predicate": null + } }, "id": null, "generator": false, diff --git a/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json b/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json index 8a6e657af3..35d26afbfb 100644 --- a/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json +++ b/test/fixtures/flow/type-annotations/existential-type-param-2/expected.json @@ -118,6 +118,7 @@ "column": 38 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 27, @@ -146,8 +147,7 @@ "column": 31 } } - }, - "predicate": null + } }, "id": null, "generator": false, From c8ac8abad7bcdc7091c58580b356645d42bc79d3 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Tue, 4 Apr 2017 22:07:44 +0200 Subject: [PATCH 073/105] Update yarn.lock --- yarn.lock | 341 ++++++++++++++++++++++++------------------------------ 1 file changed, 152 insertions(+), 189 deletions(-) diff --git a/yarn.lock b/yarn.lock index 053ad947e3..2dc08b13c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -44,14 +44,14 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" - acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" +acorn@^5.0.1: + version "5.0.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" + ajv-keywords@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" @@ -187,7 +187,7 @@ async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" -async@^1.4.0, async@^1.4.2: +async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" @@ -377,14 +377,13 @@ babel-core@7.0.0-alpha.6: source-map "^0.5.0" babel-eslint@^7.0.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.1.1.tgz#8a6a884f085aa7060af69cfc77341c2f99370fb2" + version "7.2.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.1.tgz#079422eb73ba811e3ca0865ce87af29327f8c52f" dependencies: - babel-code-frame "^6.16.0" - babel-traverse "^6.15.0" - babel-types "^6.15.0" - babylon "^6.13.0" - lodash.pickby "^4.6.0" + babel-code-frame "^6.22.0" + babel-traverse "^6.23.1" + babel-types "^6.23.0" + babylon "^6.16.1" babel-generator@7.0.0-alpha.3: version "7.0.0-alpha.3" @@ -638,12 +637,12 @@ babel-plugin-external-helpers@^7.0.0-alpha.3: resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-7.0.0-alpha.3.tgz#0fd8b75ae487025f1ad61616aaeb3850d1c9ad63" babel-plugin-istanbul@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.0.0.tgz#36bde8fbef4837e5ff0366531a2beabd7b1ffa10" + version "4.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.1.tgz#c12de0fc6fe42adfb16be56f1ad11e4a9782eca9" dependencies: find-up "^2.1.0" - istanbul-lib-instrument "^1.4.2" - test-exclude "^4.0.0" + istanbul-lib-instrument "^1.6.2" + test-exclude "^4.0.3" babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" @@ -1134,7 +1133,7 @@ babel-traverse@7.0.0-alpha.3: invariant "^2.2.0" lodash "^4.2.0" -babel-traverse@^6.15.0, babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1: +babel-traverse@^6.18.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1: version "6.23.1" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" dependencies: @@ -1156,7 +1155,7 @@ babel-types@7.0.0-alpha.3: lodash "^4.2.0" to-fast-properties "^1.0.1" -babel-types@^6.15.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0, babel-types@^6.7.2: +babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0, babel-types@^6.7.2: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" dependencies: @@ -1169,7 +1168,7 @@ babylon@7.0.0-beta.7: version "7.0.0-beta.7" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.7.tgz#61454c26b0e285ffe826dd237d5b5d179f602e16" -babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: +babylon@^6.1.0, babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.16.1: version "6.16.1" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" @@ -1482,8 +1481,8 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" convert-source-map@^1.1.0, convert-source-map@^1.2.0, convert-source-map@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.4.0.tgz#e3dad195bf61bfe13a7a3c73e9876ec14a0268f3" + version "1.5.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" convert-to-spaces@^1.0.1: version "1.0.2" @@ -1570,12 +1569,6 @@ debug@^2.1.1, debug@^2.2.0: dependencies: ms "0.7.2" -debug@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" - dependencies: - ms "0.7.1" - decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1677,8 +1670,8 @@ error-ex@^1.2.0: is-arrayish "^0.2.1" es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.14" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.14.tgz#625bc9ab9cac0f6fb9dc271525823d1800b3d360" + version "0.10.15" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.15.tgz#c330a5934c1ee21284a7c081a86e5fd937c91ea6" dependencies: es6-iterator "2" es6-symbol "~3.1" @@ -1746,14 +1739,14 @@ eslint-config-babel@^6.0.0: resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-6.0.0.tgz#66feedf6ce6e04abe585cec1a65b5bcc96bed50a" eslint-plugin-flowtype@^2.20.0: - version "2.30.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.3.tgz#57835d2c0ed388da7a2725803ec32af2f437c301" + version "2.30.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.4.tgz#771d6bb4578ab8598e9c58018fea2e1a22946249" dependencies: lodash "^4.15.0" eslint@^3.7.1: - version "3.18.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.18.0.tgz#647e985c4ae71502d20ac62c109f66d5104c8a4b" + version "3.19.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" dependencies: babel-code-frame "^6.16.0" chalk "^1.1.3" @@ -1801,10 +1794,10 @@ espower-location-detector@^1.0.0: xtend "^4.0.0" espree@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d" + version "3.4.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.1.tgz#28a83ab4aaed71ed8fe0f5efe61b76a05c13c4d2" dependencies: - acorn "4.0.4" + acorn "^5.0.1" acorn-jsx "^3.0.0" esprima@^3.1.1: @@ -2019,7 +2012,7 @@ fsevents@^1.0.0: nan "^2.3.0" node-pre-gyp "^0.6.29" -fstream-ignore@~1.0.5: +fstream-ignore@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" dependencies: @@ -2027,7 +2020,7 @@ fstream-ignore@~1.0.5: inherits "2" minimatch "^3.0.0" -fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" dependencies: @@ -2111,8 +2104,8 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6: path-is-absolute "^1.0.0" globals@^9.0.0, globals@^9.14.0: - version "9.16.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80" + version "9.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" globby@^5.0.0: version "5.0.0" @@ -2235,8 +2228,8 @@ home-or-tmp@^3.0.0: resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" hosted-git-info@^2.1.4: - version "2.3.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.3.1.tgz#ac439421605f0beb0ea1349de7d8bb28e50be1dd" + version "2.4.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.1.tgz#4b0445e41c004a8bd1337773a4ff790ca40318c8" http-signature@~1.1.0: version "1.1.1" @@ -2302,8 +2295,8 @@ inquirer@^0.12.0: through "^2.3.6" interpret@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" + version "1.0.2" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.2.tgz#f4f623f0bb7122f15f5717c8e254b8161b5c5b2d" invariant@^2.2.0: version "2.2.2" @@ -2500,9 +2493,9 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" -isexe@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-1.1.2.tgz#36f3e22e60750920f5e7241a476a8c6a42275ad0" +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" isobject@^2.0.0: version "2.1.0" @@ -2514,51 +2507,49 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-lib-coverage@^1.0.0, istanbul-lib-coverage@^1.0.0-alpha, istanbul-lib-coverage@^1.0.0-alpha.0, istanbul-lib-coverage@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.1.tgz#f263efb519c051c5f1f3343034fc40e7b43ff212" +istanbul-lib-coverage@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.2.tgz#87a0c015b6910651cb3b184814dfb339337e25e1" -istanbul-lib-hook@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.0.tgz#fc5367ee27f59268e8f060b0c7aaf051d9c425c5" +istanbul-lib-hook@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.5.tgz#6ca3d16d60c5f4082da39f7c5cd38ea8a772b88e" dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.4.2.tgz#0e2fdfac93c1dabf2e31578637dc78a19089f43e" +istanbul-lib-instrument@^1.6.2, istanbul-lib-instrument@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.0.tgz#b8e0dc25709bb44e17336ab47b7bb5c97c23f659" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.13.0" - istanbul-lib-coverage "^1.0.0" + istanbul-lib-coverage "^1.0.2" semver "^5.3.0" -istanbul-lib-report@^1.0.0-alpha.3: - version "1.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.0.0-alpha.3.tgz#32d5f6ec7f33ca3a602209e278b2e6ff143498af" +istanbul-lib-report@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.0.0.tgz#d83dac7f26566b521585569367fe84ccfc7aaecb" dependencies: - async "^1.4.2" - istanbul-lib-coverage "^1.0.0-alpha" + istanbul-lib-coverage "^1.0.2" mkdirp "^0.5.1" path-parse "^1.0.5" - rimraf "^2.4.3" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.1.0.tgz#9d429218f35b823560ea300a96ff0c3bbdab785f" +istanbul-lib-source-maps@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.1.1.tgz#f8c8c2e8f2160d1d91526d97e5bd63b2079af71c" dependencies: - istanbul-lib-coverage "^1.0.0-alpha.0" + istanbul-lib-coverage "^1.0.2" mkdirp "^0.5.1" rimraf "^2.4.4" source-map "^0.5.3" -istanbul-reports@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.1.tgz#9a17176bc4a6cbebdae52b2f15961d52fa623fbc" +istanbul-reports@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.2.tgz#4e8366abe6fa746cc1cd6633f108de12cc6ac6fa" dependencies: handlebars "^4.0.3" @@ -2753,10 +2744,6 @@ lodash.isequal@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" -lodash.pickby@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" - lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -2858,15 +2845,15 @@ micromatch@^2.1.5, micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" -mime-db@~1.26.0: - version "1.26.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.26.0.tgz#eaffcd0e4fc6935cf8134da246e2e6c35305adff" +mime-db@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" mime-types@^2.1.12, mime-types@~2.1.7: - version "2.1.14" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.14.tgz#f7ef7d97583fcaf3b7d282b6f8b5679dab1e94ee" + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" dependencies: - mime-db "~1.26.0" + mime-db "~1.27.0" mimic-fn@^1.0.0: version "1.1.0" @@ -2886,16 +2873,12 @@ minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -ms@0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" - ms@0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" @@ -2926,28 +2909,29 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" node-pre-gyp@^0.6.29: - version "0.6.33" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz#640ac55198f6a925972e0c16c4ac26a034d5ecc9" - dependencies: - mkdirp "~0.5.1" - nopt "~3.0.6" - npmlog "^4.0.1" - rc "~1.1.6" - request "^2.79.0" - rimraf "~2.5.4" - semver "~5.3.0" - tar "~2.2.1" - tar-pack "~3.3.0" + version "0.6.34" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.34.tgz#94ad1c798a11d7fc67381b50d47f8cc18d9799f7" + dependencies: + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "^2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" node-status-codes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-1.0.0.tgz#5ae5541d024645d32a58fcddc9ceecea7ae3ac2f" -nopt@~3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" dependencies: abbrev "1" + osenv "^0.1.4" normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.3.6" @@ -2959,8 +2943,10 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: validate-npm-package-license "^3.0.1" normalize-path@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" npm-run-path@^2.0.0: version "2.0.2" @@ -2968,7 +2954,7 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npmlog@^4.0.1: +npmlog@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f" dependencies: @@ -2982,8 +2968,8 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" nyc@^10.0.0: - version "10.1.2" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.1.2.tgz#ea7acaa20a235210101604f4e7d56d28453b0274" + version "10.2.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.2.0.tgz#facd90240600c9aa4dd81ea99c2fb6a85c53de0c" dependencies: archy "^1.0.0" arrify "^1.0.1" @@ -2995,12 +2981,12 @@ nyc@^10.0.0: find-up "^1.1.2" foreground-child "^1.5.3" glob "^7.0.6" - istanbul-lib-coverage "^1.0.1" - istanbul-lib-hook "^1.0.0" - istanbul-lib-instrument "^1.4.2" - istanbul-lib-report "^1.0.0-alpha.3" - istanbul-lib-source-maps "^1.1.0" - istanbul-reports "^1.0.0" + istanbul-lib-coverage "^1.0.2" + istanbul-lib-hook "^1.0.5" + istanbul-lib-instrument "^1.7.0" + istanbul-lib-report "^1.0.0" + istanbul-lib-source-maps "^1.1.1" + istanbul-reports "^1.0.2" md5-hex "^1.2.0" merge-source-map "^1.0.2" micromatch "^2.3.11" @@ -3009,8 +2995,8 @@ nyc@^10.0.0: rimraf "^2.5.4" signal-exit "^3.0.1" spawn-wrap "1.2.4" - test-exclude "^3.3.0" - yargs "^6.6.0" + test-exclude "^4.0.0" + yargs "^7.0.2" yargs-parser "^4.0.2" oauth-sign@~0.8.1: @@ -3035,25 +3021,19 @@ observable-to-promise@^0.4.0: is-observable "^0.2.0" symbol-observable "^0.2.2" -once@^1.3.0: +once@^1.3.0, once@^1.3.3: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: wrappy "1" -once@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" - dependencies: - wrappy "1" - onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" onetime@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.0.tgz#52aa8110e52fc5126ffc667bd8ec21c2ed209ce6" + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" dependencies: mimic-fn "^1.0.0" @@ -3095,7 +3075,7 @@ os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@^0.1.0: +osenv@^0.1.0, osenv@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" dependencies: @@ -3320,9 +3300,9 @@ randomatic@^1.1.3: is-number "^2.0.2" kind-of "^3.0.2" -rc@^1.0.1, rc@^1.1.6, rc@~1.1.6: - version "1.1.7" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.7.tgz#c5ea564bb07aff9fd3a5b32e906c1d3a65940fea" +rc@^1.0.1, rc@^1.1.6, rc@^1.1.7: + version "1.2.1" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" dependencies: deep-extend "~0.4.0" ini "~1.3.0" @@ -3366,7 +3346,7 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2: +readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: version "2.2.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.6.tgz#8b43aed76e71483938d12a8d46c6cf1a00b1f816" dependencies: @@ -3378,18 +3358,6 @@ readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2. string_decoder "~0.10.x" util-deprecate "~1.0.1" -readable-stream@~2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" - dependencies: - buffer-shims "^1.0.0" - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - readdirp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" @@ -3500,6 +3468,10 @@ regjsparser@^0.2.1: dependencies: jsesc "~0.5.0" +remove-trailing-separator@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4" + repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" @@ -3514,7 +3486,7 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -request@^2.79.0: +request@^2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: @@ -3608,18 +3580,12 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.3, rimraf@^2.4.4, rimraf@^2.5.4: +rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.4, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: glob "^7.0.5" -rimraf@~2.5.1, rimraf@~2.5.4: - version "2.5.4" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" - dependencies: - glob "^7.0.5" - rollup-plugin-babel@^2.6.1: version "2.7.1" resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" @@ -3677,7 +3643,7 @@ semver-diff@^2.0.0: dependencies: semver "^5.0.3" -"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@~5.3.0: +"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -3891,20 +3857,20 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -tar-pack@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" - dependencies: - debug "~2.2.0" - fstream "~1.0.10" - fstream-ignore "~1.0.5" - once "~1.3.3" - readable-stream "~2.1.4" - rimraf "~2.5.1" - tar "~2.2.1" - uid-number "~0.0.6" - -tar@~2.2.1: +tar-pack@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984" + dependencies: + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" + +tar@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" dependencies: @@ -3912,19 +3878,9 @@ tar@~2.2.1: fstream "^1.0.2" inherits "2" -test-exclude@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-3.3.0.tgz#7a17ca1239988c98367b0621456dbb7d4bc38977" - dependencies: - arrify "^1.0.1" - micromatch "^2.3.11" - object-assign "^4.1.0" - read-pkg-up "^1.0.1" - require-main-filename "^1.0.1" - -test-exclude@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.0.tgz#0ddc0100b8ae7e88b34eb4fd98a907e961991900" +test-exclude@^4.0.0, test-exclude@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.3.tgz#86a13ce3effcc60e6c90403cf31a27a60ac6c4e7" dependencies: arrify "^1.0.1" micromatch "^2.3.11" @@ -4007,18 +3963,19 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" uglify-js@^2.6: - version "2.8.13" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.13.tgz#d0cdf02f3c661484fac601b7e723207b735a374c" + version "2.8.21" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.21.tgz#1733f669ae6f82fc90c7b25ec0f5c783ee375314" dependencies: source-map "~0.5.1" - uglify-to-browserify "~1.0.0" yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" -uid-number@~0.0.6: +uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" @@ -4109,8 +4066,8 @@ uuid@^3.0.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" v8flags@^2.0.10: - version "2.0.11" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.0.11.tgz#bca8f30f0d6d60612cc2c00641e6962d42ae6881" + version "2.0.12" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.0.12.tgz#73235d9f7176f8e8833fb286795445f7938d84e5" dependencies: user-home "^1.1.1" @@ -4132,10 +4089,10 @@ which-module@^1.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" which@^1.2.4, which@^1.2.9: - version "1.2.12" - resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192" + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: - isexe "^1.1.1" + isexe "^2.0.0" wide-align@^1.1.0: version "1.1.0" @@ -4225,15 +4182,21 @@ yallist@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" -yargs-parser@^4.0.2, yargs-parser@^4.2.0: +yargs-parser@^4.0.2: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" dependencies: camelcase "^3.0.0" -yargs@^6.6.0: - version "6.6.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + dependencies: + camelcase "^3.0.0" + +yargs@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.0.2.tgz#115b97df1321823e8b8648e8968c782521221f67" dependencies: camelcase "^3.0.0" cliui "^3.2.0" @@ -4247,7 +4210,7 @@ yargs@^6.6.0: string-width "^1.0.2" which-module "^1.0.0" y18n "^3.2.1" - yargs-parser "^4.2.0" + yargs-parser "^5.0.0" yargs@~3.10.0: version "3.10.0" From 4147c01ac0b2de79d0dad1ba88a99b6886e8eece Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Tue, 4 Apr 2017 22:08:28 +0200 Subject: [PATCH 074/105] 7.0.0-beta.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e91bbf38f6..676bbcf261 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "7.0.0-beta.7", + "version": "7.0.0-beta.8", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From ed452b6f78340d110aaf32ddabcf68363d4506f6 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Tue, 4 Apr 2017 23:16:59 +0200 Subject: [PATCH 075/105] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0184164cdc..690dcbf810 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,6 +98,8 @@ cd ../../packages/babel-traverse/ yarn link babylon cd ../../packages/babel-generator/ yarn link babylon +cd ../../packages/babel-types/ +yarn link babylon cd ../.. make build make test From 1c07efb5fc75f1878826813c00948a1ebc2ec662 Mon Sep 17 00:00:00 2001 From: Logan Smyth Date: Wed, 5 Apr 2017 12:16:51 -0700 Subject: [PATCH 076/105] Use a .babelignore to skip compiling lib and fixtures. (#451) --- .babelignore | 2 ++ Makefile | 2 +- scripts/test-babel-register.js | 10 ---------- 3 files changed, 3 insertions(+), 11 deletions(-) create mode 100644 .babelignore delete mode 100644 scripts/test-babel-register.js diff --git a/.babelignore b/.babelignore new file mode 100644 index 0000000000..ec46d9b5e8 --- /dev/null +++ b/.babelignore @@ -0,0 +1,2 @@ +test/fixtures +lib diff --git a/Makefile b/Makefile index c3ea88785d..351fc07848 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ test-babel: cd ./build/babel; \ jq "del(.nyc)" package.json > package.nonyc.json; \ mv -f package.nonyc.json package.json; \ - ../../node_modules/.bin/nyc --no-instrument --no-source-map --reporter=json --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts --compilers js:../../scripts/test-babel-register.js; \ + ../../node_modules/.bin/nyc --no-instrument --no-source-map --reporter=json --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts --compilers js:babel-register; \ bootstrap-flow: clean mkdir ./build diff --git a/scripts/test-babel-register.js b/scripts/test-babel-register.js deleted file mode 100644 index d70a3ff7ff..0000000000 --- a/scripts/test-babel-register.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -const register = require("babel-register").default; - -register({ - extensions: [".js"], - // Only js files in the test folder but not in the subfolder fixtures. - only: [/packages\/.+\/test\/(?!fixtures\/).+\.js$/], - compact: true, -}); From 4bf18ccbeae12b8a88eeba07a22914332d1208f0 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 6 Apr 2017 10:48:20 -0700 Subject: [PATCH 077/105] Simplify `cd` commands (#452) [skip ci] --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 690dcbf810..eefd2e2706 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -92,13 +92,13 @@ make bootstrap yarn link babylon cd packages/babel-core/ yarn link babylon -cd ../../packages/babel-template/ +cd ../babel-template/ yarn link babylon -cd ../../packages/babel-traverse/ +cd ../babel-traverse/ yarn link babylon -cd ../../packages/babel-generator/ +cd ../babel-generator/ yarn link babylon -cd ../../packages/babel-types/ +cd ../babel-types/ yarn link babylon cd ../.. make build From aef9e4fb5cc791b0686086139cd930a891bb1015 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 7 Apr 2017 15:02:11 +0200 Subject: [PATCH 078/105] =?UTF-8?q?Update=20flow-bin=20to=20the=20latest?= =?UTF-8?q?=20version=20=F0=9F=9A=80=20(#448)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update flow-bin to version 0.43.0 https://greenkeeper.io/ * Update yarn.lock --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 676bbcf261..85f3a7328b 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.20.0", - "flow-bin": "^0.42.0", + "flow-bin": "^0.43.0", "nyc": "^10.0.0", "rimraf": "^2.5.4", "rollup": "^0.41.0", diff --git a/yarn.lock b/yarn.lock index 2dc08b13c0..7aef1b221e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1960,9 +1960,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.42.0: - version "0.42.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.42.0.tgz#05dd754b6b052de7b150f9210e2160746961e3cf" +flow-bin@^0.43.0: + version "0.43.1" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.43.1.tgz#0733958b448fb8ad4b1576add7e87c31794c81bc" fn-name@^2.0.0: version "2.0.1" From 344f0704451e60bd346fffcf7366fde1eaf93034 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 7 Apr 2017 15:52:19 +0200 Subject: [PATCH 079/105] =?UTF-8?q?Update=20ava=20to=20the=20latest=20vers?= =?UTF-8?q?ion=20=F0=9F=9A=80=20(#450)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update ava to version 0.19.0 https://greenkeeper.io/ * Fix tests for latest ava --- package.json | 2 +- test/estree-throws.js | 2 +- test/expressions.js | 5 + test/{utils => helpers}/runFixtureTests.js | 28 +- test/index.js | 5 +- yarn.lock | 465 +++++++++++++-------- 6 files changed, 309 insertions(+), 198 deletions(-) create mode 100644 test/expressions.js rename test/{utils => helpers}/runFixtureTests.js (86%) diff --git a/package.json b/package.json index 85f3a7328b..3b00c3f6ff 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "node": ">=4.2.0" }, "devDependencies": { - "ava": "^0.18.0", + "ava": "^0.19.0", "babel-cli": "^7.0.0-alpha.6", "babel-eslint": "^7.0.0", "babel-helper-fixtures": "^7.0.0-alpha.3", diff --git a/test/estree-throws.js b/test/estree-throws.js index eba937611a..8eeae5dbb5 100644 --- a/test/estree-throws.js +++ b/test/estree-throws.js @@ -1,5 +1,5 @@ import path from "path"; -import { runThrowTestsWithEstree } from "./utils/runFixtureTests"; +import { runThrowTestsWithEstree } from "./helpers/runFixtureTests"; import { parse } from "../lib"; runThrowTestsWithEstree(path.join(__dirname, "fixtures"), parse); diff --git a/test/expressions.js b/test/expressions.js new file mode 100644 index 0000000000..6ecb36971f --- /dev/null +++ b/test/expressions.js @@ -0,0 +1,5 @@ +import path from "path"; +import { runFixtureTests } from "./helpers/runFixtureTests"; +import { parseExpression } from "../lib"; + +runFixtureTests(path.join(__dirname, "expressions"), parseExpression); diff --git a/test/utils/runFixtureTests.js b/test/helpers/runFixtureTests.js similarity index 86% rename from test/utils/runFixtureTests.js rename to test/helpers/runFixtureTests.js index 723c3051e7..c37edcff04 100644 --- a/test/utils/runFixtureTests.js +++ b/test/helpers/runFixtureTests.js @@ -1,7 +1,7 @@ -var test = require("ava"); -var getFixtures = require("babel-helper-fixtures").multiple; +import test from "ava"; +import { multiple as getFixtures } from "babel-helper-fixtures"; -exports.runFixtureTests = function runFixtureTests(fixturesPath, parseFunction) { +export function runFixtureTests(fixturesPath, parseFunction) { var fixtures = getFixtures(fixturesPath); Object.keys(fixtures).forEach(function (name) { @@ -9,12 +9,13 @@ exports.runFixtureTests = function runFixtureTests(fixturesPath, parseFunction) testSuite.tests.forEach(function (task) { var testFn = task.disabled ? test.skip : task.options.only ? test.only : test; - testFn(name + "/" + testSuite.title + "/" + task.title, function () { + testFn(name + "/" + testSuite.title + "/" + task.title, function (t) { try { - return runTest(task, parseFunction); + runTest(task, parseFunction); + t.pass(); } catch (err) { - err.message = name + "/" + task.actual.filename + ": " + err.message; - throw err; + const message = name + "/" + task.actual.filename + ": " + err.message; + t.fail(message); } }); }); @@ -22,7 +23,7 @@ exports.runFixtureTests = function runFixtureTests(fixturesPath, parseFunction) }); }; -exports.runThrowTestsWithEstree = function runThrowTestsWithEstree(fixturesPath, parseFunction) { +export function runThrowTestsWithEstree(fixturesPath, parseFunction) { var fixtures = getFixtures(fixturesPath); Object.keys(fixtures).forEach(function (name) { @@ -35,12 +36,13 @@ exports.runThrowTestsWithEstree = function runThrowTestsWithEstree(fixturesPath, var testFn = task.disabled ? test.skip : task.options.only ? test.only : test; - testFn(name + "/" + testSuite.title + "/" + task.title, function () { + testFn(name + "/" + testSuite.title + "/" + task.title, function (t) { try { - return runTest(task, parseFunction); + runTest(task, parseFunction); + t.pass(); } catch (err) { - err.message = task.actual.loc + ": " + err.message; - throw err; + const message = name + "/" + task.actual.filename + ": " + err.message; + t.fail(message); } }); }); @@ -90,8 +92,8 @@ function runTest(test, parseFunction) { throw new Error("Expected error message: " + opts.throws + ". But parsing succeeded."); } else { var mis = misMatch(JSON.parse(test.expect.code), ast); + if (mis) { - //save(test, ast); throw new Error(mis); } } diff --git a/test/index.js b/test/index.js index 9e4b5d513a..7ec91fb86a 100644 --- a/test/index.js +++ b/test/index.js @@ -1,6 +1,5 @@ import path from "path"; -import { runFixtureTests } from "./utils/runFixtureTests"; -import { parse, parseExpression } from "../lib"; +import { runFixtureTests } from "./helpers/runFixtureTests"; +import { parse } from "../lib"; runFixtureTests(path.join(__dirname, "fixtures"), parse); -runFixtureTests(path.join(__dirname, "expressions"), parseExpression); diff --git a/yarn.lock b/yarn.lock index 7aef1b221e..bf7311170c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,10 @@ # yarn lockfile v1 +"@ava/babel-plugin-throws-helper@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@ava/babel-plugin-throws-helper/-/babel-plugin-throws-helper-2.0.0.tgz#2fc1fe3c211a71071a4eca7b8f7af5842cd1ae7c" + "@ava/babel-preset-stage-4@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@ava/babel-preset-stage-4/-/babel-preset-stage-4-1.0.0.tgz#a613b5e152f529305422546b072d47facfb26291" @@ -19,13 +23,12 @@ babel-plugin-transform-exponentiation-operator "^6.8.0" package-hash "^1.2.0" -"@ava/babel-preset-transform-test-files@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@ava/babel-preset-transform-test-files/-/babel-preset-transform-test-files-2.0.1.tgz#d75232cc6d71dc9c7eae4b76a9004fd81501d0c1" +"@ava/babel-preset-transform-test-files@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@ava/babel-preset-transform-test-files/-/babel-preset-transform-test-files-3.0.0.tgz#cded1196a8d8d9381a509240ab92e91a5ec069f7" dependencies: - babel-plugin-ava-throws-helper "^1.0.0" + "@ava/babel-plugin-throws-helper" "^2.0.0" babel-plugin-espower "^2.3.2" - package-hash "^1.2.0" "@ava/pretty-format@^1.1.0": version "1.1.0" @@ -93,6 +96,12 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" +ansi-styles@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.0.0.tgz#5404e93a544c4fec7f048262977bebfe3155e0c1" + dependencies: + color-convert "^1.0.0" + ansi-styles@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178" @@ -209,12 +218,12 @@ ava-init@^0.2.0: read-pkg-up "^2.0.0" write-pkg "^2.0.0" -ava@^0.18.0: - version "0.18.2" - resolved "https://registry.yarnpkg.com/ava/-/ava-0.18.2.tgz#79253d1636077034a2780bb55b5c3e6c3d7f312f" +ava@^0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/ava/-/ava-0.19.0.tgz#6c8c03c9f3f4036f701dbb3fdc487ab4d6533537" dependencies: "@ava/babel-preset-stage-4" "^1.0.0" - "@ava/babel-preset-transform-test-files" "^2.0.0" + "@ava/babel-preset-transform-test-files" "^3.0.0" "@ava/pretty-format" "^1.1.0" arr-flatten "^1.0.1" array-union "^1.0.1" @@ -232,7 +241,7 @@ ava@^0.18.0: clean-yaml-object "^0.1.0" cli-cursor "^2.1.0" cli-spinners "^1.0.0" - cli-truncate "^0.2.0" + cli-truncate "^1.0.0" co-with-promise "^4.6.0" code-excerpt "^2.1.0" common-path-prefix "^1.0.0" @@ -241,15 +250,17 @@ ava@^0.18.0: currently-unhandled "^0.4.1" debug "^2.2.0" diff "^3.0.1" + diff-match-patch "^1.0.0" dot-prop "^4.1.0" empower-core "^0.6.1" equal-length "^1.0.0" figures "^2.0.0" find-cache-dir "^0.1.1" fn-name "^2.0.0" - get-port "^2.1.0" + get-port "^3.0.0" globby "^6.0.0" has-flag "^2.0.0" + hullabaloo-config-manager "^1.0.0" ignore-by-default "^1.0.0" indent-string "^3.0.0" is-ci "^1.0.7" @@ -257,7 +268,9 @@ ava@^0.18.0: is-obj "^1.0.0" is-observable "^0.2.0" is-promise "^2.1.0" - jest-snapshot "^18.1.0" + jest-diff "19.0.0" + jest-snapshot "19.0.2" + js-yaml "^3.8.2" last-line-stream "^1.0.0" lodash.debounce "^4.0.3" lodash.difference "^4.3.0" @@ -265,14 +278,14 @@ ava@^0.18.0: lodash.isequal "^4.5.0" loud-rejection "^1.2.0" matcher "^0.1.1" - max-timeout "^1.0.0" md5-hex "^2.0.0" meow "^3.7.0" + mkdirp "^0.5.1" ms "^0.7.1" multimatch "^2.1.0" - observable-to-promise "^0.4.0" + observable-to-promise "^0.5.0" option-chain "^0.1.0" - package-hash "^1.2.0" + package-hash "^2.0.0" pkg-conf "^2.0.0" plur "^2.0.0" pretty-ms "^2.0.0" @@ -283,9 +296,10 @@ ava@^0.18.0: stack-utils "^1.0.0" strip-ansi "^3.0.1" strip-bom-buf "^1.0.0" + supports-color "^3.2.3" time-require "^0.1.2" unique-temp-dir "^1.0.0" - update-notifier "^1.0.0" + update-notifier "^2.1.0" aws-sign2@~0.6.0: version "0.6.0" @@ -603,13 +617,6 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-ava-throws-helper@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-ava-throws-helper/-/babel-plugin-ava-throws-helper-1.0.0.tgz#8fe6e79d2fd19838b5c3649f89cfb03fd563e241" - dependencies: - babel-template "^6.7.0" - babel-types "^6.7.2" - babel-plugin-check-es2015-constants@7.0.0-alpha.3: version "7.0.0-alpha.3" resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-7.0.0-alpha.3.tgz#bc83e61842bf8769515e7f69cb43cf7f2546aaba" @@ -1110,7 +1117,7 @@ babel-template@7.0.0-alpha.3: babylon "7.0.0-beta.7" lodash "^4.2.0" -babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.23.0, babel-template@^6.7.0: +babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638" dependencies: @@ -1155,7 +1162,7 @@ babel-types@7.0.0-alpha.3: lodash "^4.2.0" to-fast-properties "^1.0.1" -babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0, babel-types@^6.7.2: +babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" dependencies: @@ -1202,18 +1209,16 @@ boom@2.x.x: dependencies: hoek "2.x.x" -boxen@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-0.6.0.tgz#8364d4248ac34ff0ef1b2f2bf49a6c60ce0d81b6" +boxen@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.0.0.tgz#b2694baf1f605f708ff0177c12193b22f29aaaab" dependencies: ansi-align "^1.1.0" - camelcase "^2.1.0" + camelcase "^4.0.0" chalk "^1.1.1" cli-boxes "^1.0.0" - filled-array "^1.0.0" - object-assign "^4.0.1" - repeating "^2.0.0" - string-width "^1.0.1" + string-width "^2.0.0" + term-size "^0.1.0" widest-line "^1.0.0" brace-expansion@^1.0.0: @@ -1291,7 +1296,7 @@ camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^2.0.0, camelcase@^2.1.0: +camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -1299,6 +1304,10 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" +camelcase@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + capture-stack-trace@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" @@ -1383,12 +1392,12 @@ cli-spinners@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.0.0.tgz#ef987ed3d48391ac3dab9180b406a742180d6e6a" -cli-truncate@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" +cli-truncate@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-1.0.0.tgz#21eb91f47b3f6560f004db77a769b4668d9c5518" dependencies: slice-ansi "0.0.4" - string-width "^1.0.1" + string-width "^2.0.0" cli-width@^2.0.0: version "2.1.0" @@ -1430,6 +1439,16 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" +color-convert@^1.0.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" + combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" @@ -1462,19 +1481,16 @@ concat-stream@^1.5.2: readable-stream "^2.2.2" typedarray "^0.0.6" -configstore@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-2.1.0.tgz#737a3a7036e9886102aa6099e47bb33ab1aba1a1" +configstore@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.0.0.tgz#e1b8669c1803ccc50b545e92f8e6e79aa80e0196" dependencies: - dot-prop "^3.0.0" + dot-prop "^4.1.0" graceful-fs "^4.1.2" mkdirp "^0.5.0" - object-assign "^4.0.1" - os-tmpdir "^1.0.0" - osenv "^0.1.0" - uuid "^2.0.1" + unique-string "^1.0.0" write-file-atomic "^1.1.2" - xdg-basedir "^2.0.0" + xdg-basedir "^3.0.0" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" @@ -1503,7 +1519,7 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -create-error-class@^3.0.1: +create-error-class@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" dependencies: @@ -1516,6 +1532,13 @@ cross-env@^4.0.0: cross-spawn "^5.1.0" is-windows "^1.0.0" +cross-spawn-async@^2.1.1: + version "2.2.5" + resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc" + dependencies: + lru-cache "^4.0.0" + which "^1.2.8" + cross-spawn@^4, cross-spawn@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" @@ -1537,6 +1560,10 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" +crypto-random-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -1617,6 +1644,10 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" +diff-match-patch@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/diff-match-patch/-/diff-match-patch-1.0.0.tgz#1cc3c83a490d67f95d91e39f6ad1f2e086b63048" + diff@^3.0.0, diff@^3.0.1: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" @@ -1628,23 +1659,15 @@ doctrine@^2.0.0: esutils "^2.0.2" isarray "^1.0.0" -dot-prop@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" - dependencies: - is-obj "^1.0.0" - dot-prop@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.1.1.tgz#a8493f0b7b5eeec82525b5c7587fa7de7ca859c1" dependencies: is-obj "^1.0.0" -duplexer2@^0.1.4: +duplexer3@^0.1.4: version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" - dependencies: - readable-stream "^2.0.2" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" ecc-jsbn@~0.1.1: version "0.1.1" @@ -1676,6 +1699,10 @@ es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: es6-iterator "2" es6-symbol "~3.1" +es6-error@^4.0.1, es6-error@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.0.2.tgz#eec5c726eacef51b7f6b73c20db6e1b13b069c98" + es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" @@ -1846,6 +1873,17 @@ event-emitter@~0.3.5: d "1" es5-ext "~0.10.14" +execa@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.4.0.tgz#4eb6467a36a095fabb2970ff9d5e3fb7bce6ebc3" + dependencies: + cross-spawn-async "^2.1.1" + is-stream "^1.1.0" + npm-run-path "^1.0.0" + object-assign "^4.0.1" + path-key "^1.0.0" + strip-eof "^1.0.0" + execa@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" @@ -1926,10 +1964,6 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -filled-array@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/filled-array/-/filled-array-1.1.0.tgz#c3c4f6c663b923459a9aa29912d2d031f1507f84" - find-cache-dir@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" @@ -2056,11 +2090,9 @@ get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" -get-port@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/get-port/-/get-port-2.1.0.tgz#8783f9dcebd1eea495a334e1a6a251e78887ab1a" - dependencies: - pinkie-promise "^2.0.0" +get-port@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.1.0.tgz#ef01b18a84ca6486970ff99e54446141a73ffd3e" get-stdin@^4.0.1: version "4.0.1" @@ -2073,6 +2105,10 @@ get-stream@^2.2.0: object-assign "^4.0.1" pinkie-promise "^2.0.0" +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + getpass@^0.1.1: version "0.1.6" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" @@ -2128,24 +2164,20 @@ globby@^6.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -got@^5.0.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/got/-/got-5.7.1.tgz#5f81635a61e4a6589f180569ea4e381680a51f35" +got@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" dependencies: - create-error-class "^3.0.1" - duplexer2 "^0.1.4" + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" is-redirect "^1.0.0" is-retry-allowed "^1.0.0" is-stream "^1.0.0" lowercase-keys "^1.0.0" - node-status-codes "^1.0.0" - object-assign "^4.0.1" - parse-json "^2.1.0" - pinkie-promise "^2.0.0" - read-all-stream "^3.0.0" - readable-stream "^2.0.5" - timed-out "^3.0.0" - unzip-response "^1.0.2" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + unzip-response "^2.0.1" url-parse-lax "^1.0.0" graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: @@ -2239,6 +2271,24 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" +hullabaloo-config-manager@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hullabaloo-config-manager/-/hullabaloo-config-manager-1.0.0.tgz#70403e68afa009a577bb134306bb71b6b45aaa70" + dependencies: + dot-prop "^4.1.0" + es6-error "^4.0.2" + graceful-fs "^4.1.11" + indent-string "^3.1.0" + json5 "^0.5.1" + lodash.clonedeep "^4.5.0" + lodash.clonedeepwith "^4.5.0" + lodash.isequal "^4.5.0" + lodash.merge "^4.6.0" + md5-hex "^2.0.0" + package-hash "^2.0.0" + pkg-dir "^1.0.0" + resolve-from "^2.0.0" + ignore-by-default@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" @@ -2257,7 +2307,7 @@ indent-string@^2.1.0: dependencies: repeating "^2.0.0" -indent-string@^3.0.0: +indent-string@^3.0.0, indent-string@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.1.0.tgz#08ff4334603388399b329e6b9538dc7a3cf5de7d" @@ -2553,52 +2603,71 @@ istanbul-reports@^1.0.2: dependencies: handlebars "^4.0.3" -jest-diff@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-18.1.0.tgz#4ff79e74dd988c139195b365dc65d87f606f4803" +jest-diff@19.0.0, jest-diff@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" dependencies: chalk "^1.1.3" diff "^3.0.0" - jest-matcher-utils "^18.1.0" - pretty-format "^18.1.0" + jest-matcher-utils "^19.0.0" + pretty-format "^19.0.0" -jest-file-exists@^17.0.0: - version "17.0.0" - resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-17.0.0.tgz#7f63eb73a1c43a13f461be261768b45af2cdd169" +jest-file-exists@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" -jest-matcher-utils@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-18.1.0.tgz#1ac4651955ee2a60cef1e7fcc98cdfd773c0f932" +jest-matcher-utils@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" dependencies: chalk "^1.1.3" - pretty-format "^18.1.0" + pretty-format "^19.0.0" -jest-mock@^18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-18.0.0.tgz#5c248846ea33fa558b526f5312ab4a6765e489b3" +jest-message-util@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-19.0.0.tgz#721796b89c0e4d761606f9ba8cb828a3b6246416" + dependencies: + chalk "^1.1.1" + micromatch "^2.3.11" -jest-snapshot@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-18.1.0.tgz#55b96d2ee639c9bce76f87f2a3fd40b71c7a5916" +jest-mock@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-19.0.0.tgz#67038641e9607ab2ce08ec4a8cb83aabbc899d01" + +jest-snapshot@19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-19.0.2.tgz#9c1b216214f7187c38bfd5c70b1efab16b0ff50b" dependencies: - jest-diff "^18.1.0" - jest-file-exists "^17.0.0" - jest-matcher-utils "^18.1.0" - jest-util "^18.1.0" + chalk "^1.1.3" + jest-diff "^19.0.0" + jest-file-exists "^19.0.0" + jest-matcher-utils "^19.0.0" + jest-util "^19.0.2" natural-compare "^1.4.0" - pretty-format "^18.1.0" + pretty-format "^19.0.0" -jest-util@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-18.1.0.tgz#3a99c32114ab17f84be094382527006e6d4bfc6a" +jest-util@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-19.0.2.tgz#e0a0232a2ab9e6b2b53668bdb3534c2b5977ed41" dependencies: chalk "^1.1.1" - diff "^3.0.0" graceful-fs "^4.1.6" - jest-file-exists "^17.0.0" - jest-mock "^18.0.0" + jest-file-exists "^19.0.0" + jest-message-util "^19.0.0" + jest-mock "^19.0.0" + jest-validate "^19.0.2" + leven "^2.0.0" mkdirp "^0.5.1" +jest-validate@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.2.tgz#dc534df5f1278d5b63df32b14241d4dbf7244c0c" + dependencies: + chalk "^1.1.1" + jest-matcher-utils "^19.0.0" + leven "^2.0.0" + pretty-format "^19.0.0" + jodid25519@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" @@ -2609,7 +2678,7 @@ js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@^3.5.1: +js-yaml@^3.5.1, js-yaml@^3.8.2: version "3.8.2" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.2.tgz#02d3e2c0f6beab20248d412c352203827d786721" dependencies: @@ -2642,7 +2711,7 @@ json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -json5@^0.5.0: +json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -2675,19 +2744,19 @@ last-line-stream@^1.0.0: dependencies: through2 "^2.0.0" -latest-version@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-2.0.0.tgz#56f8d6139620847b8017f8f1f4d78e211324168b" +latest-version@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" dependencies: - package-json "^2.0.0" + package-json "^4.0.0" lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" -lazy-req@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/lazy-req/-/lazy-req-1.1.0.tgz#bdaebead30f8d824039ce0ce149d4daa07ba1fac" +lazy-req@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lazy-req/-/lazy-req-2.0.0.tgz#c9450a363ecdda2e6f0c70132ad4f37f8f06f2b4" lcid@^1.0.0: version "1.0.0" @@ -2695,6 +2764,10 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" +leven@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -2728,6 +2801,14 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + +lodash.clonedeepwith@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeepwith/-/lodash.clonedeepwith-4.5.0.tgz#6ee30573a03a1a60d670a62ef33c10cf1afdbdd4" + lodash.debounce@^4.0.3: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -2740,10 +2821,18 @@ lodash.flatten@^4.2.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + lodash.isequal@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" +lodash.merge@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.0.tgz#69884ba144ac33fe699737a6086deffadd0f89c5" + lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -2769,7 +2858,7 @@ lowercase-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" -lru-cache@^4.0.1: +lru-cache@^4.0.0, lru-cache@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" dependencies: @@ -2786,10 +2875,6 @@ matcher@^0.1.1: dependencies: escape-string-regexp "^1.0.4" -max-timeout@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/max-timeout/-/max-timeout-1.0.0.tgz#b68f69a2f99e0b476fd4cb23e2059ca750715e1f" - md5-hex@^1.2.0, md5-hex@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" @@ -2879,14 +2964,10 @@ minimist@^1.1.3, minimist@^1.2.0: dependencies: minimist "0.0.8" -ms@0.7.2: +ms@0.7.2, ms@^0.7.1: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" -ms@^0.7.1: - version "0.7.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" - multimatch@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" @@ -2922,10 +3003,6 @@ node-pre-gyp@^0.6.29: tar "^2.2.1" tar-pack "^3.4.0" -node-status-codes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-status-codes/-/node-status-codes-1.0.0.tgz#5ae5541d024645d32a58fcddc9ceecea7ae3ac2f" - nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -2948,6 +3025,12 @@ normalize-path@^2.0.1: dependencies: remove-trailing-separator "^1.0.1" +npm-run-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-1.0.0.tgz#f5c32bf595fe81ae927daec52e82f8b000ac3c8f" + dependencies: + path-key "^1.0.0" + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -3014,12 +3097,12 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -observable-to-promise@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/observable-to-promise/-/observable-to-promise-0.4.0.tgz#28afe71645308f2d41d71f47ad3fece1a377e52b" +observable-to-promise@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/observable-to-promise/-/observable-to-promise-0.5.0.tgz#c828f0f0dc47e9f86af8a4977c5d55076ce7a91f" dependencies: is-observable "^0.2.0" - symbol-observable "^0.2.2" + symbol-observable "^1.0.4" once@^1.3.0, once@^1.3.3: version "1.4.0" @@ -3075,7 +3158,7 @@ os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@^0.1.0, osenv@^0.1.4: +osenv@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" dependencies: @@ -3110,11 +3193,20 @@ package-hash@^1.2.0: dependencies: md5-hex "^1.3.0" -package-json@^2.0.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-2.4.0.tgz#0d15bd67d1cbbddbb2ca222ff2edb86bcb31a8bb" +package-hash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/package-hash/-/package-hash-2.0.0.tgz#78ae326c89e05a4d813b68601977af05c00d2a0d" dependencies: - got "^5.0.0" + graceful-fs "^4.1.11" + lodash.flattendeep "^4.4.0" + md5-hex "^2.0.0" + release-zalgo "^1.0.0" + +package-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.0.tgz#f3c9dc8738f5b59304d54d2cfb3f91d08fdd7998" + dependencies: + got "^6.7.1" registry-auth-token "^3.0.1" registry-url "^3.0.3" semver "^5.1.0" @@ -3128,7 +3220,7 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" -parse-json@^2.1.0, parse-json@^2.2.0: +parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" dependencies: @@ -3160,6 +3252,10 @@ path-is-inside@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" +path-key@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af" + path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -3249,11 +3345,11 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -pretty-format@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-18.1.0.tgz#fb65a86f7a7f9194963eee91865c1bcf1039e284" +pretty-format@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84" dependencies: - ansi-styles "^2.2.1" + ansi-styles "^3.0.0" pretty-ms@^0.2.1: version "0.2.2" @@ -3309,13 +3405,6 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -read-all-stream@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa" - dependencies: - pinkie-promise "^2.0.0" - readable-stream "^2.0.0" - read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -3346,7 +3435,7 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: +"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: version "2.2.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.6.tgz#8b43aed76e71483938d12a8d46c6cf1a00b1f816" dependencies: @@ -3468,6 +3557,12 @@ regjsparser@^0.2.1: dependencies: jsesc "~0.5.0" +release-zalgo@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" + dependencies: + es6-error "^4.0.1" + remove-trailing-separator@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4" @@ -3836,7 +3931,7 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^3.1.2: +supports-color@^3.1.2, supports-color@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: @@ -3846,6 +3941,10 @@ symbol-observable@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" +symbol-observable@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" + table@^3.7.8: version "3.8.3" resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" @@ -3878,6 +3977,12 @@ tar@^2.2.1: fstream "^1.0.2" inherits "2" +term-size@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-0.1.1.tgz#87360b96396cab5760963714cda0d0cbeecad9ca" + dependencies: + execa "^0.4.0" + test-exclude@^4.0.0, test-exclude@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.3.tgz#86a13ce3effcc60e6c90403cf31a27a60ac6c4e7" @@ -3912,9 +4017,9 @@ time-require@^0.1.2: pretty-ms "^0.2.1" text-table "^0.2.0" -timed-out@^3.0.0: - version "3.1.3" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-3.1.3.tgz#95860bfcc5c76c277f8f8326fd0f5b2e20eba217" +timed-out@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" to-fast-properties@^1.0.1: version "1.0.2" @@ -4012,6 +4117,12 @@ unicode-property-value-aliases@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/unicode-property-value-aliases/-/unicode-property-value-aliases-1.2.2.tgz#12a3746fc66f75f08a3f4a8d56780f89f49acbbd" +unique-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + dependencies: + crypto-random-string "^1.0.0" + unique-temp-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz#6dce95b2681ca003eebfb304a415f9cbabcc5385" @@ -4020,22 +4131,22 @@ unique-temp-dir@^1.0.0: os-tmpdir "^1.0.1" uid2 "0.0.3" -unzip-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-1.0.2.tgz#b984f0877fc0a89c2c773cc1ef7b5b232b5b06fe" +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" -update-notifier@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-1.0.3.tgz#8f92c515482bd6831b7c93013e70f87552c7cf5a" +update-notifier@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.1.0.tgz#ec0c1e53536b76647a24b77cb83966d9315123d9" dependencies: - boxen "^0.6.0" + boxen "^1.0.0" chalk "^1.0.0" - configstore "^2.0.0" + configstore "^3.0.0" is-npm "^1.0.0" - latest-version "^2.0.0" - lazy-req "^1.1.0" + latest-version "^3.0.0" + lazy-req "^2.0.0" semver-diff "^2.0.0" - xdg-basedir "^2.0.0" + xdg-basedir "^3.0.0" url-parse-lax@^1.0.0: version "1.0.0" @@ -4057,10 +4168,6 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -uuid@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" - uuid@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" @@ -4088,7 +4195,7 @@ which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" -which@^1.2.4, which@^1.2.9: +which@^1.2.4, which@^1.2.8, which@^1.2.9: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: @@ -4164,11 +4271,9 @@ write@^0.2.1: dependencies: mkdirp "^0.5.1" -xdg-basedir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz#edbc903cc385fc04523d966a335504b5504d1bd2" - dependencies: - os-homedir "^1.0.0" +xdg-basedir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" From 637119a017c3aa12876dda6601ce2be35196ec57 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Mon, 10 Apr 2017 10:48:51 -0500 Subject: [PATCH 080/105] Fix typo in flow spread operator error [skip ci] --- src/plugins/flow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/flow.js b/src/plugins/flow.js index faeec9d006..ba54902303 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -454,7 +454,7 @@ pp.flowParseObjectType = function (allowStatic, allowExact, allowSpread) { if (!allowSpread) { this.unexpected( null, - "Spread operator cannnot appear in class or interface definitions" + "Spread operator cannot appear in class or interface definitions" ); } if (variance) { From 482b8155a3adc2977039ce3572728621e6ab5e08 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 10 Apr 2017 09:24:34 -0700 Subject: [PATCH 081/105] Update test baselines (#461) --- test/fixtures/flow/type-annotations/137/options.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/flow/type-annotations/137/options.json b/test/fixtures/flow/type-annotations/137/options.json index 79756f8c33..786acad32a 100644 --- a/test/fixtures/flow/type-annotations/137/options.json +++ b/test/fixtures/flow/type-annotations/137/options.json @@ -1,3 +1,3 @@ { - "throws": "Spread operator cannnot appear in class or interface definitions (2:1)" + "throws": "Spread operator cannot appear in class or interface definitions (2:1)" } From 17f2a2036c1fb8442eaa5bd7b9ad3c5d270d36e0 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 19 Apr 2017 06:59:49 -0500 Subject: [PATCH 082/105] Allow namespace exotic to be exported as default (#474) --- src/parser/statement.js | 2 +- .../export-extensions/ns-default/actual.js | 1 + .../ns-default/expected.json | 103 ++++++++++++++++++ 3 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/experimental/export-extensions/ns-default/actual.js create mode 100644 test/fixtures/experimental/export-extensions/ns-default/expected.json diff --git a/src/parser/statement.js b/src/parser/statement.js index 3a1eafa407..08885a009c 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -816,7 +816,7 @@ pp.parseExport = function (node) { const specifier = this.startNode(); this.next(); if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) { - specifier.exported = this.parseIdentifier(); + specifier.exported = this.parseIdentifier(true); node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")]; this.parseExportSpecifiersMaybe(node); this.parseExportFrom(node, true); diff --git a/test/fixtures/experimental/export-extensions/ns-default/actual.js b/test/fixtures/experimental/export-extensions/ns-default/actual.js new file mode 100644 index 0000000000..871cd28fa8 --- /dev/null +++ b/test/fixtures/experimental/export-extensions/ns-default/actual.js @@ -0,0 +1 @@ +export * as default from "foo"; diff --git a/test/fixtures/experimental/export-extensions/ns-default/expected.json b/test/fixtures/experimental/export-extensions/ns-default/expected.json new file mode 100644 index 0000000000..38c5f40bd5 --- /dev/null +++ b/test/fixtures/experimental/export-extensions/ns-default/expected.json @@ -0,0 +1,103 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "module", + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "specifiers": [ + { + "type": "ExportNamespaceSpecifier", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "exported": { + "type": "Identifier", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "default" + }, + "name": "default" + } + } + ], + "source": { + "type": "StringLiteral", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file From 2ef436641ee62d2f7f023f2425ee946b17424d78 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 19 Apr 2017 07:08:51 -0500 Subject: [PATCH 083/105] Ensure locations in ObjectTypeAnnotations do not include semi or comma (#472) --- src/plugins/flow.js | 12 ++----- .../flow/call-properties/2/expected.json | 4 +-- .../flow/call-properties/3/expected.json | 8 ++--- .../flow/call-properties/4/expected.json | 4 +-- .../flow/call-properties/5/expected.json | 4 +-- .../named-static/expected.json | 4 +-- .../flow/declare-module/5/expected.json | 4 +-- .../flow/declare-module/6/expected.json | 4 +-- .../flow/declare-statements/10/expected.json | 4 +-- .../flow/declare-statements/17/expected.json | 12 +++---- .../flow/declare-statements/7/expected.json | 4 +-- .../10/expected.json | 12 +++---- .../4/expected.json | 4 +-- .../5/expected.json | 4 +-- .../flow/type-annotations/108/expected.json | 28 ++++++++-------- .../flow/type-annotations/135/expected.json | 4 +-- .../flow/type-annotations/136/expected.json | 8 ++--- .../flow/type-annotations/33/expected.json | 4 +-- .../flow/type-annotations/34/expected.json | 4 +-- .../flow/type-annotations/36/expected.json | 4 +-- .../flow/type-annotations/39/expected.json | 4 +-- .../flow/type-annotations/40/expected.json | 4 +-- .../flow/type-annotations/43/expected.json | 4 +-- .../flow/type-annotations/60/expected.json | 4 +-- .../flow/type-annotations/63/expected.json | 4 +-- .../flow/type-annotations/98/expected.json | 12 +++---- .../expected.json | 32 +++++++++---------- .../expected.json | 16 +++++----- .../interface-reserved-word/expected.json | 16 +++++----- .../type-object-reserved-word/expected.json | 16 +++++----- test/fixtures/flow/typecasts/2/expected.json | 4 +-- 31 files changed, 123 insertions(+), 129 deletions(-) diff --git a/src/plugins/flow.js b/src/plugins/flow.js index ba54902303..15302e40dd 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -352,11 +352,7 @@ pp.flowParseObjectTypeIndexer = function (node, isStatic, variance) { node.value = this.flowParseTypeInitialiser(); node.variance = variance; - // Finish node first to not include a possible semicolon in the locations - const indexer = this.finishNode(node, "ObjectTypeIndexer"); - this.flowObjectTypeSemicolon(); - - return indexer; + return this.finishNode(node, "ObjectTypeIndexer"); }; pp.flowParseObjectTypeMethodish = function (node) { @@ -391,7 +387,6 @@ pp.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) { node.static = isStatic; node.key = key; node.optional = false; - this.flowObjectTypeSemicolon(); return this.finishNode(node, "ObjectTypeProperty"); }; @@ -399,7 +394,6 @@ pp.flowParseObjectTypeCallProperty = function (node, isStatic) { const valueNode = this.startNode(); node.static = isStatic; node.value = this.flowParseObjectTypeMethodish(valueNode); - this.flowObjectTypeSemicolon(); return this.finishNode(node, "ObjectTypeCallProperty"); }; @@ -462,7 +456,6 @@ pp.flowParseObjectType = function (allowStatic, allowExact, allowSpread) { } this.expect(tt.ellipsis); node.argument = this.flowParseType(); - this.flowObjectTypeSemicolon(); nodeStart.properties.push(this.finishNode(node, "ObjectTypeSpreadProperty")); } else { propertyKey = this.flowParseObjectPropertyKey(); @@ -481,12 +474,13 @@ pp.flowParseObjectType = function (allowStatic, allowExact, allowSpread) { node.optional = optional; node.static = isStatic; node.variance = variance; - this.flowObjectTypeSemicolon(); nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty")); } } } + this.flowObjectTypeSemicolon(); + isStatic = false; } diff --git a/test/fixtures/flow/call-properties/2/expected.json b/test/fixtures/flow/call-properties/2/expected.json index 2efe8bd9d6..87148b542a 100644 --- a/test/fixtures/flow/call-properties/2/expected.json +++ b/test/fixtures/flow/call-properties/2/expected.json @@ -105,7 +105,7 @@ { "type": "ObjectTypeCallProperty", "start": 10, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -113,7 +113,7 @@ }, "end": { "line": 1, - "column": 21 + "column": 20 } }, "static": false, diff --git a/test/fixtures/flow/call-properties/3/expected.json b/test/fixtures/flow/call-properties/3/expected.json index e1c7645c97..d5d5d6599e 100644 --- a/test/fixtures/flow/call-properties/3/expected.json +++ b/test/fixtures/flow/call-properties/3/expected.json @@ -105,7 +105,7 @@ { "type": "ObjectTypeCallProperty", "start": 10, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -113,7 +113,7 @@ }, "end": { "line": 1, - "column": 21 + "column": 20 } }, "static": false, @@ -254,7 +254,7 @@ { "type": "ObjectTypeProperty", "start": 22, - "end": 32, + "end": 31, "loc": { "start": { "line": 1, @@ -262,7 +262,7 @@ }, "end": { "line": 1, - "column": 32 + "column": 31 } }, "key": { diff --git a/test/fixtures/flow/call-properties/4/expected.json b/test/fixtures/flow/call-properties/4/expected.json index bbfa2011f1..08e9c26694 100644 --- a/test/fixtures/flow/call-properties/4/expected.json +++ b/test/fixtures/flow/call-properties/4/expected.json @@ -105,7 +105,7 @@ { "type": "ObjectTypeCallProperty", "start": 10, - "end": 28, + "end": 27, "loc": { "start": { "line": 1, @@ -113,7 +113,7 @@ }, "end": { "line": 1, - "column": 28 + "column": 27 } }, "static": false, diff --git a/test/fixtures/flow/call-properties/5/expected.json b/test/fixtures/flow/call-properties/5/expected.json index c836470490..74587ef411 100644 --- a/test/fixtures/flow/call-properties/5/expected.json +++ b/test/fixtures/flow/call-properties/5/expected.json @@ -80,7 +80,7 @@ { "type": "ObjectTypeCallProperty", "start": 14, - "end": 25, + "end": 24, "loc": { "start": { "line": 1, @@ -88,7 +88,7 @@ }, "end": { "line": 1, - "column": 25 + "column": 24 } }, "static": false, diff --git a/test/fixtures/flow/class-properties/named-static/expected.json b/test/fixtures/flow/class-properties/named-static/expected.json index e3d5623c98..61bf3d6674 100644 --- a/test/fixtures/flow/class-properties/named-static/expected.json +++ b/test/fixtures/flow/class-properties/named-static/expected.json @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 20, - "end": 30, + "end": 29, "loc": { "start": { "line": 2, @@ -89,7 +89,7 @@ }, "end": { "line": 2, - "column": 12 + "column": 11 } }, "key": { diff --git a/test/fixtures/flow/declare-module/5/expected.json b/test/fixtures/flow/declare-module/5/expected.json index 2933f44c40..27fad53409 100644 --- a/test/fixtures/flow/declare-module/5/expected.json +++ b/test/fixtures/flow/declare-module/5/expected.json @@ -127,7 +127,7 @@ { "type": "ObjectTypeProperty", "start": 37, - "end": 51, + "end": 50, "loc": { "start": { "line": 1, @@ -135,7 +135,7 @@ }, "end": { "line": 1, - "column": 51 + "column": 50 } }, "value": { diff --git a/test/fixtures/flow/declare-module/6/expected.json b/test/fixtures/flow/declare-module/6/expected.json index cd42bf7057..8024e7d3d1 100644 --- a/test/fixtures/flow/declare-module/6/expected.json +++ b/test/fixtures/flow/declare-module/6/expected.json @@ -121,7 +121,7 @@ { "type": "ObjectTypeProperty", "start": 45, - "end": 59, + "end": 58, "loc": { "start": { "line": 1, @@ -129,7 +129,7 @@ }, "end": { "line": 1, - "column": 59 + "column": 58 } }, "value": { diff --git a/test/fixtures/flow/declare-statements/10/expected.json b/test/fixtures/flow/declare-statements/10/expected.json index a047f9c004..2e0049fb41 100644 --- a/test/fixtures/flow/declare-statements/10/expected.json +++ b/test/fixtures/flow/declare-statements/10/expected.json @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 18, - "end": 39, + "end": 38, "loc": { "start": { "line": 1, @@ -89,7 +89,7 @@ }, "end": { "line": 1, - "column": 39 + "column": 38 } }, "value": { diff --git a/test/fixtures/flow/declare-statements/17/expected.json b/test/fixtures/flow/declare-statements/17/expected.json index 292b96e24c..381229ee19 100644 --- a/test/fixtures/flow/declare-statements/17/expected.json +++ b/test/fixtures/flow/declare-statements/17/expected.json @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 19, - "end": 29, + "end": 28, "loc": { "start": { "line": 2, @@ -89,7 +89,7 @@ }, "end": { "line": 2, - "column": 11 + "column": 10 } }, "key": { @@ -131,7 +131,7 @@ { "type": "ObjectTypeProperty", "start": 31, - "end": 48, + "end": 47, "loc": { "start": { "line": 3, @@ -139,7 +139,7 @@ }, "end": { "line": 3, - "column": 18 + "column": 17 } }, "key": { @@ -181,7 +181,7 @@ { "type": "ObjectTypeProperty", "start": 50, - "end": 60, + "end": 59, "loc": { "start": { "line": 4, @@ -189,7 +189,7 @@ }, "end": { "line": 4, - "column": 11 + "column": 10 } }, "key": { diff --git a/test/fixtures/flow/declare-statements/7/expected.json b/test/fixtures/flow/declare-statements/7/expected.json index 1fd92b3412..776a6a6a9e 100644 --- a/test/fixtures/flow/declare-statements/7/expected.json +++ b/test/fixtures/flow/declare-statements/7/expected.json @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 29, - "end": 72, + "end": 71, "loc": { "start": { "line": 1, @@ -89,7 +89,7 @@ }, "end": { "line": 1, - "column": 72 + "column": 71 } }, "value": { diff --git a/test/fixtures/flow/interfaces-module-and-script/10/expected.json b/test/fixtures/flow/interfaces-module-and-script/10/expected.json index ea68f99b99..4c7e6d03c9 100644 --- a/test/fixtures/flow/interfaces-module-and-script/10/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/10/expected.json @@ -80,7 +80,7 @@ { "type": "ObjectTypeCallProperty", "start": 33, - "end": 49, + "end": 48, "loc": { "start": { "line": 3, @@ -88,7 +88,7 @@ }, "end": { "line": 3, - "column": 18 + "column": 17 } }, "static": true, @@ -131,7 +131,7 @@ { "type": "ObjectTypeProperty", "start": 19, - "end": 30, + "end": 29, "loc": { "start": { "line": 2, @@ -139,7 +139,7 @@ }, "end": { "line": 2, - "column": 13 + "column": 12 } }, "key": { @@ -181,7 +181,7 @@ { "type": "ObjectTypeProperty", "start": 52, - "end": 70, + "end": 69, "loc": { "start": { "line": 4, @@ -189,7 +189,7 @@ }, "end": { "line": 4, - "column": 20 + "column": 19 } }, "key": { diff --git a/test/fixtures/flow/interfaces-module-and-script/4/expected.json b/test/fixtures/flow/interfaces-module-and-script/4/expected.json index b6b9f6d2c7..1099bd54e8 100644 --- a/test/fixtures/flow/interfaces-module-and-script/4/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/4/expected.json @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 14, - "end": 32, + "end": 31, "loc": { "start": { "line": 1, @@ -89,7 +89,7 @@ }, "end": { "line": 1, - "column": 32 + "column": 31 } }, "key": { diff --git a/test/fixtures/flow/interfaces-module-and-script/5/expected.json b/test/fixtures/flow/interfaces-module-and-script/5/expected.json index 58cbc95f06..042154f2d0 100644 --- a/test/fixtures/flow/interfaces-module-and-script/5/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/5/expected.json @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 48, - "end": 63, + "end": 62, "loc": { "start": { "line": 1, @@ -89,7 +89,7 @@ }, "end": { "line": 1, - "column": 63 + "column": 62 } }, "key": { diff --git a/test/fixtures/flow/type-annotations/108/expected.json b/test/fixtures/flow/type-annotations/108/expected.json index ae2c71d275..cc7cae44e2 100644 --- a/test/fixtures/flow/type-annotations/108/expected.json +++ b/test/fixtures/flow/type-annotations/108/expected.json @@ -106,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 11, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -114,7 +114,7 @@ }, "end": { "line": 1, - "column": 21 + "column": 20 } }, "key": { @@ -418,7 +418,7 @@ { "type": "ObjectTypeProperty", "start": 68, - "end": 78, + "end": 77, "loc": { "start": { "line": 2, @@ -426,7 +426,7 @@ }, "end": { "line": 2, - "column": 21 + "column": 20 } }, "key": { @@ -468,7 +468,7 @@ { "type": "ObjectTypeProperty", "start": 79, - "end": 89, + "end": 88, "loc": { "start": { "line": 2, @@ -476,7 +476,7 @@ }, "end": { "line": 2, - "column": 32 + "column": 31 } }, "key": { @@ -830,7 +830,7 @@ { "type": "ObjectTypeProperty", "start": 145, - "end": 175, + "end": 174, "loc": { "start": { "line": 4, @@ -838,7 +838,7 @@ }, "end": { "line": 4, - "column": 40 + "column": 39 } }, "key": { @@ -877,7 +877,7 @@ { "type": "ObjectTypeProperty", "start": 151, - "end": 161, + "end": 160, "loc": { "start": { "line": 4, @@ -885,7 +885,7 @@ }, "end": { "line": 4, - "column": 26 + "column": 25 } }, "key": { @@ -1350,7 +1350,7 @@ { "type": "ObjectTypeProperty", "start": 239, - "end": 267, + "end": 266, "loc": { "start": { "line": 5, @@ -1358,7 +1358,7 @@ }, "end": { "line": 5, - "column": 39 + "column": 38 } }, "key": { @@ -1397,7 +1397,7 @@ { "type": "ObjectTypeProperty", "start": 244, - "end": 254, + "end": 253, "loc": { "start": { "line": 5, @@ -1405,7 +1405,7 @@ }, "end": { "line": 5, - "column": 26 + "column": 25 } }, "key": { diff --git a/test/fixtures/flow/type-annotations/135/expected.json b/test/fixtures/flow/type-annotations/135/expected.json index 6f973de0f6..14027b107e 100644 --- a/test/fixtures/flow/type-annotations/135/expected.json +++ b/test/fixtures/flow/type-annotations/135/expected.json @@ -79,7 +79,7 @@ { "type": "ObjectTypeSpreadProperty", "start": 12, - "end": 19, + "end": 18, "loc": { "start": { "line": 2, @@ -87,7 +87,7 @@ }, "end": { "line": 2, - "column": 8 + "column": 7 } }, "argument": { diff --git a/test/fixtures/flow/type-annotations/136/expected.json b/test/fixtures/flow/type-annotations/136/expected.json index 18d746c433..ca0bd530db 100644 --- a/test/fixtures/flow/type-annotations/136/expected.json +++ b/test/fixtures/flow/type-annotations/136/expected.json @@ -79,7 +79,7 @@ { "type": "ObjectTypeProperty", "start": 12, - "end": 18, + "end": 17, "loc": { "start": { "line": 2, @@ -87,7 +87,7 @@ }, "end": { "line": 2, - "column": 7 + "column": 6 } }, "key": { @@ -133,7 +133,7 @@ { "type": "ObjectTypeSpreadProperty", "start": 20, - "end": 26, + "end": 25, "loc": { "start": { "line": 3, @@ -141,7 +141,7 @@ }, "end": { "line": 3, - "column": 7 + "column": 6 } }, "argument": { diff --git a/test/fixtures/flow/type-annotations/33/expected.json b/test/fixtures/flow/type-annotations/33/expected.json index 9c2bc6c2da..7739fea5f1 100644 --- a/test/fixtures/flow/type-annotations/33/expected.json +++ b/test/fixtures/flow/type-annotations/33/expected.json @@ -106,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -114,7 +114,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "key": { diff --git a/test/fixtures/flow/type-annotations/34/expected.json b/test/fixtures/flow/type-annotations/34/expected.json index a9ca235616..aa0ad93518 100644 --- a/test/fixtures/flow/type-annotations/34/expected.json +++ b/test/fixtures/flow/type-annotations/34/expected.json @@ -106,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -114,7 +114,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "key": { diff --git a/test/fixtures/flow/type-annotations/36/expected.json b/test/fixtures/flow/type-annotations/36/expected.json index 4ef8af37d3..4ccc7c692f 100644 --- a/test/fixtures/flow/type-annotations/36/expected.json +++ b/test/fixtures/flow/type-annotations/36/expected.json @@ -106,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -114,7 +114,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "key": { diff --git a/test/fixtures/flow/type-annotations/39/expected.json b/test/fixtures/flow/type-annotations/39/expected.json index aeb80942b7..ba0346f3e3 100644 --- a/test/fixtures/flow/type-annotations/39/expected.json +++ b/test/fixtures/flow/type-annotations/39/expected.json @@ -106,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -114,7 +114,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "key": { diff --git a/test/fixtures/flow/type-annotations/40/expected.json b/test/fixtures/flow/type-annotations/40/expected.json index 57f986dc1b..bd5b46e71f 100644 --- a/test/fixtures/flow/type-annotations/40/expected.json +++ b/test/fixtures/flow/type-annotations/40/expected.json @@ -106,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -114,7 +114,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "key": { diff --git a/test/fixtures/flow/type-annotations/43/expected.json b/test/fixtures/flow/type-annotations/43/expected.json index f74ef8a76c..d888673773 100644 --- a/test/fixtures/flow/type-annotations/43/expected.json +++ b/test/fixtures/flow/type-annotations/43/expected.json @@ -106,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 9, - "end": 24, + "end": 23, "loc": { "start": { "line": 1, @@ -114,7 +114,7 @@ }, "end": { "line": 1, - "column": 24 + "column": 23 } }, "value": { diff --git a/test/fixtures/flow/type-annotations/60/expected.json b/test/fixtures/flow/type-annotations/60/expected.json index 41854c7041..71d0a6e5f9 100644 --- a/test/fixtures/flow/type-annotations/60/expected.json +++ b/test/fixtures/flow/type-annotations/60/expected.json @@ -161,7 +161,7 @@ { "type": "ObjectTypeProperty", "start": 10, - "end": 20, + "end": 19, "loc": { "start": { "line": 1, @@ -169,7 +169,7 @@ }, "end": { "line": 1, - "column": 20 + "column": 19 } }, "key": { diff --git a/test/fixtures/flow/type-annotations/63/expected.json b/test/fixtures/flow/type-annotations/63/expected.json index e9bbce62ed..e0bbfe124f 100644 --- a/test/fixtures/flow/type-annotations/63/expected.json +++ b/test/fixtures/flow/type-annotations/63/expected.json @@ -167,7 +167,7 @@ { "type": "ObjectTypeProperty", "start": 20, - "end": 30, + "end": 29, "loc": { "start": { "line": 1, @@ -175,7 +175,7 @@ }, "end": { "line": 1, - "column": 30 + "column": 29 } }, "key": { diff --git a/test/fixtures/flow/type-annotations/98/expected.json b/test/fixtures/flow/type-annotations/98/expected.json index 230760de3a..7100fa77f8 100644 --- a/test/fixtures/flow/type-annotations/98/expected.json +++ b/test/fixtures/flow/type-annotations/98/expected.json @@ -106,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 24, + "end": 23, "loc": { "start": { "line": 1, @@ -114,7 +114,7 @@ }, "end": { "line": 1, - "column": 24 + "column": 23 } }, "key": { @@ -156,7 +156,7 @@ { "type": "ObjectTypeProperty", "start": 25, - "end": 40, + "end": 39, "loc": { "start": { "line": 1, @@ -164,7 +164,7 @@ }, "end": { "line": 1, - "column": 40 + "column": 39 } }, "key": { @@ -206,7 +206,7 @@ { "type": "ObjectTypeProperty", "start": 41, - "end": 56, + "end": 55, "loc": { "start": { "line": 1, @@ -214,7 +214,7 @@ }, "end": { "line": 1, - "column": 56 + "column": 55 } }, "key": { diff --git a/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json index a18b53c12e..df4896c159 100644 --- a/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 20, - "end": 38, + "end": 37, "loc": { "start": { "line": 2, @@ -89,7 +89,7 @@ }, "end": { "line": 2, - "column": 20 + "column": 19 } }, "value": { @@ -181,7 +181,7 @@ { "type": "ObjectTypeProperty", "start": 41, - "end": 59, + "end": 58, "loc": { "start": { "line": 3, @@ -189,7 +189,7 @@ }, "end": { "line": 3, - "column": 20 + "column": 19 } }, "value": { @@ -281,7 +281,7 @@ { "type": "ObjectTypeProperty", "start": 62, - "end": 79, + "end": 78, "loc": { "start": { "line": 4, @@ -289,7 +289,7 @@ }, "end": { "line": 4, - "column": 19 + "column": 18 } }, "value": { @@ -381,7 +381,7 @@ { "type": "ObjectTypeProperty", "start": 82, - "end": 96, + "end": 95, "loc": { "start": { "line": 5, @@ -389,7 +389,7 @@ }, "end": { "line": 5, - "column": 16 + "column": 15 } }, "value": { @@ -481,7 +481,7 @@ { "type": "ObjectTypeProperty", "start": 99, - "end": 124, + "end": 123, "loc": { "start": { "line": 6, @@ -489,7 +489,7 @@ }, "end": { "line": 6, - "column": 27 + "column": 26 } }, "value": { @@ -581,7 +581,7 @@ { "type": "ObjectTypeProperty", "start": 127, - "end": 152, + "end": 151, "loc": { "start": { "line": 7, @@ -589,7 +589,7 @@ }, "end": { "line": 7, - "column": 27 + "column": 26 } }, "value": { @@ -681,7 +681,7 @@ { "type": "ObjectTypeProperty", "start": 155, - "end": 179, + "end": 178, "loc": { "start": { "line": 8, @@ -689,7 +689,7 @@ }, "end": { "line": 8, - "column": 26 + "column": 25 } }, "value": { @@ -781,7 +781,7 @@ { "type": "ObjectTypeProperty", "start": 182, - "end": 203, + "end": 202, "loc": { "start": { "line": 9, @@ -789,7 +789,7 @@ }, "end": { "line": 9, - "column": 23 + "column": 22 } }, "value": { diff --git a/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json index 834cc17454..d6ee0660f0 100644 --- a/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 24, - "end": 42, + "end": 41, "loc": { "start": { "line": 2, @@ -89,7 +89,7 @@ }, "end": { "line": 2, - "column": 20 + "column": 19 } }, "value": { @@ -181,7 +181,7 @@ { "type": "ObjectTypeProperty", "start": 45, - "end": 63, + "end": 62, "loc": { "start": { "line": 3, @@ -189,7 +189,7 @@ }, "end": { "line": 3, - "column": 20 + "column": 19 } }, "value": { @@ -281,7 +281,7 @@ { "type": "ObjectTypeProperty", "start": 66, - "end": 83, + "end": 82, "loc": { "start": { "line": 4, @@ -289,7 +289,7 @@ }, "end": { "line": 4, - "column": 19 + "column": 18 } }, "value": { @@ -381,7 +381,7 @@ { "type": "ObjectTypeProperty", "start": 86, - "end": 100, + "end": 99, "loc": { "start": { "line": 5, @@ -389,7 +389,7 @@ }, "end": { "line": 5, - "column": 16 + "column": 15 } }, "value": { diff --git a/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json index 61ca321ecd..d14c0aa7a3 100644 --- a/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 16, - "end": 34, + "end": 33, "loc": { "start": { "line": 2, @@ -89,7 +89,7 @@ }, "end": { "line": 2, - "column": 20 + "column": 19 } }, "value": { @@ -181,7 +181,7 @@ { "type": "ObjectTypeProperty", "start": 37, - "end": 55, + "end": 54, "loc": { "start": { "line": 3, @@ -189,7 +189,7 @@ }, "end": { "line": 3, - "column": 20 + "column": 19 } }, "value": { @@ -281,7 +281,7 @@ { "type": "ObjectTypeProperty", "start": 58, - "end": 75, + "end": 74, "loc": { "start": { "line": 4, @@ -289,7 +289,7 @@ }, "end": { "line": 4, - "column": 19 + "column": 18 } }, "value": { @@ -381,7 +381,7 @@ { "type": "ObjectTypeProperty", "start": 78, - "end": 92, + "end": 91, "loc": { "start": { "line": 5, @@ -389,7 +389,7 @@ }, "end": { "line": 5, - "column": 16 + "column": 15 } }, "value": { diff --git a/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json index 3f2bac500b..c3bb865167 100644 --- a/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json @@ -79,7 +79,7 @@ { "type": "ObjectTypeProperty", "start": 13, - "end": 31, + "end": 30, "loc": { "start": { "line": 2, @@ -87,7 +87,7 @@ }, "end": { "line": 2, - "column": 20 + "column": 19 } }, "value": { @@ -179,7 +179,7 @@ { "type": "ObjectTypeProperty", "start": 34, - "end": 52, + "end": 51, "loc": { "start": { "line": 3, @@ -187,7 +187,7 @@ }, "end": { "line": 3, - "column": 20 + "column": 19 } }, "value": { @@ -279,7 +279,7 @@ { "type": "ObjectTypeProperty", "start": 55, - "end": 72, + "end": 71, "loc": { "start": { "line": 4, @@ -287,7 +287,7 @@ }, "end": { "line": 4, - "column": 19 + "column": 18 } }, "value": { @@ -379,7 +379,7 @@ { "type": "ObjectTypeProperty", "start": 75, - "end": 89, + "end": 88, "loc": { "start": { "line": 5, @@ -387,7 +387,7 @@ }, "end": { "line": 5, - "column": 16 + "column": 15 } }, "value": { diff --git a/test/fixtures/flow/typecasts/2/expected.json b/test/fixtures/flow/typecasts/2/expected.json index 5e58fe24de..e9f527ccb8 100644 --- a/test/fixtures/flow/typecasts/2/expected.json +++ b/test/fixtures/flow/typecasts/2/expected.json @@ -216,7 +216,7 @@ { "type": "ObjectTypeProperty", "start": 24, - "end": 36, + "end": 35, "loc": { "start": { "line": 1, @@ -224,7 +224,7 @@ }, "end": { "line": 1, - "column": 36 + "column": 35 } }, "key": { From ad284d5c36ef5b62c48bf30b24bfa7df297b02c5 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 21 Apr 2017 04:53:51 -0700 Subject: [PATCH 084/105] Convert each plugin to a function from a class to an overriding class (#459) * Convert each plugin to a function from a class to an overriding class * Handle undefined options * Fix indentation * Fix double space --- src/index.js | 40 +- src/parser/index.js | 41 +- src/plugins/estree.js | 332 +++++++-------- src/plugins/flow.js | 899 ++++++++++++++++++--------------------- src/plugins/jsx/index.js | 110 +++-- 5 files changed, 665 insertions(+), 757 deletions(-) diff --git a/src/index.js b/src/index.js index c2911f455f..a797b55f15 100755 --- a/src/index.js +++ b/src/index.js @@ -19,11 +19,11 @@ plugins.flow = flowPlugin; plugins.jsx = jsxPlugin; export function parse(input, options) { - return new Parser(options, input).parse(); + return getParser(options, input).parse(); } export function parseExpression(input, options) { - const parser = new Parser(options, input); + const parser = getParser(options, input); if (parser.options.strictMode) { parser.state.strict = true; } @@ -32,3 +32,39 @@ export function parseExpression(input, options) { export { tokTypes }; + +function getParser(options, input) { + const cls = options && options.plugins ? getParserClass(options.plugins) : Parser; + return new cls(options, input); +} + +const parserClassCache = {}; + +/** Get a Parser class with plugins applied. */ +function getParserClass(pluginsFromOptions) { + // Filter out just the plugins that have an actual mixin associated with them. + let pluginList = pluginsFromOptions.filter((p) => p === "estree" || p === "flow" || p === "jsx"); + + if (pluginList.indexOf("flow") >= 0) { + // ensure flow plugin loads last + pluginList = pluginList.filter((plugin) => plugin !== "flow"); + pluginList.push("flow"); + } + + if (pluginList.indexOf("estree") >= 0) { + // ensure estree plugin loads first + pluginList = pluginList.filter((plugin) => plugin !== "estree"); + pluginList.unshift("estree"); + } + + const key = pluginList.join("/"); + let cls = parserClassCache[key]; + if (!cls) { + cls = Parser; + for (const plugin of pluginList) { + cls = plugins[plugin](cls); + } + parserClassCache[key] = cls; + } + return cls; +} diff --git a/src/parser/index.js b/src/parser/index.js index 2a4768affb..9600040c5f 100644 --- a/src/parser/index.js +++ b/src/parser/index.js @@ -12,7 +12,7 @@ export default class Parser extends Tokenizer { this.options = options; this.inModule = this.options.sourceType === "module"; this.input = input; - this.plugins = this.loadPlugins(this.options.plugins); + this.plugins = pluginsMap(this.options.plugins); this.filename = options.sourceFilename; // If enabled, skip leading hashbang line. @@ -33,37 +33,6 @@ export default class Parser extends Tokenizer { return !!this.plugins[name]; } - extend(name: string, f: Function) { - this[name] = f(this[name]); - } - - loadPlugins(pluginList: Array): { [key: string]: boolean } { - const pluginMap = {}; - - if (pluginList.indexOf("flow") >= 0) { - // ensure flow plugin loads last - pluginList = pluginList.filter((plugin) => plugin !== "flow"); - pluginList.push("flow"); - } - - if (pluginList.indexOf("estree") >= 0) { - // ensure estree plugin loads first - pluginList = pluginList.filter((plugin) => plugin !== "estree"); - pluginList.unshift("estree"); - } - - for (const name of pluginList) { - if (!pluginMap[name]) { - pluginMap[name] = true; - - const plugin = plugins[name]; - if (plugin) plugin(this); - } - } - - return pluginMap; - } - parse(): { type: "File", program: { @@ -77,3 +46,11 @@ export default class Parser extends Tokenizer { return this.parseTopLevel(file, program); } } + +function pluginsMap(pluginList: $ReadOnlyArray): { [key: string]: boolean } { + const pluginMap = {}; + for (const name of pluginList) { + pluginMap[name] = true; + } + return pluginMap; +} diff --git a/src/plugins/estree.js b/src/plugins/estree.js index 3502e311bf..585cd7dc2b 100644 --- a/src/plugins/estree.js +++ b/src/plugins/estree.js @@ -43,206 +43,178 @@ function isSimpleProperty(node) { node.method === false; } -export default function (instance) { - instance.extend("checkDeclaration", function(inner) { - return function (node) { - if (isSimpleProperty(node)) { - this.checkDeclaration(node.value); +export default (superClass) => class extends superClass { + checkDeclaration(node) { + if (isSimpleProperty(node)) { + this.checkDeclaration(node.value); + } else { + super.checkDeclaration(node); + } + } + + checkGetterSetterParamCount(prop) { + const paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + const start = prop.start; + if (prop.kind === "get") { + this.raise(start, "getter should have no params"); } else { - inner.call(this, node); + this.raise(start, "setter should have exactly one param"); } - }; - }); - - instance.extend("checkGetterSetterParamCount", function() { - return function (prop) { - const paramCount = prop.kind === "get" ? 0 : 1; - if (prop.value.params.length !== paramCount) { - const start = prop.start; - if (prop.kind === "get") { - this.raise(start, "getter should have no params"); + } + } + + checkLVal(expr, isBinding, checkClashes, ...args) { + switch (expr.type) { + case "ObjectPattern": + expr.properties.forEach((prop) => { + this.checkLVal( + prop.type === "Property" ? prop.value : prop, + isBinding, + checkClashes, + "object destructuring pattern" + ); + }); + break; + default: + super.checkLVal(expr, isBinding, checkClashes, ...args); + } + } + + checkPropClash(prop, propHash) { + if (prop.computed || !isSimpleProperty(prop)) return; + + const key = prop.key; + // It is either an Identifier or a String/NumericLiteral + const name = key.type === "Identifier" ? key.name : String(key.value); + + if (name === "__proto__") { + if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); + propHash.proto = true; + } + } + + isStrictBody(node, isExpression) { + if (!isExpression && node.body.body.length > 0) { + for (const directive of (node.body.body: Array)) { + if (directive.type === "ExpressionStatement" && directive.expression.type === "Literal") { + if (directive.expression.value === "use strict") return true; } else { - this.raise(start, "setter should have exactly one param"); - } - } - }; - }); - - instance.extend("checkLVal", function(inner) { - return function (expr, isBinding, checkClashes, ...args) { - switch (expr.type) { - case "ObjectPattern": - expr.properties.forEach((prop) => { - this.checkLVal( - prop.type === "Property" ? prop.value : prop, - isBinding, - checkClashes, - "object destructuring pattern" - ); - }); + // Break for the first non literal expression break; - default: - inner.call(this, expr, isBinding, checkClashes, ...args); + } } - }; - }); + } - instance.extend("checkPropClash", function () { - return function (prop, propHash) { - if (prop.computed || !isSimpleProperty(prop)) return; + return false; + } - const key = prop.key; - // It is either an Identifier or a String/NumericLiteral - const name = key.type === "Identifier" ? key.name : String(key.value); + isValidDirective(stmt) { + return stmt.type === "ExpressionStatement" && + stmt.expression.type === "Literal" && + typeof stmt.expression.value === "string" && + (!stmt.expression.extra || !stmt.expression.extra.parenthesized); + } - if (name === "__proto__") { - if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); - propHash.proto = true; - } - }; - }); - - instance.extend("isStrictBody", function () { - return function (node, isExpression) { - if (!isExpression && node.body.body.length > 0) { - for (const directive of (node.body.body: Array)) { - if (directive.type === "ExpressionStatement" && directive.expression.type === "Literal") { - if (directive.expression.value === "use strict") return true; - } else { - // Break for the first non literal expression - break; - } - } - } + parseBlockBody(node, ...args) { + super.parseBlockBody(node, ...args); - return false; - }; - }); - - instance.extend("isValidDirective", function () { - return function (stmt) { - return stmt.type === "ExpressionStatement" && - stmt.expression.type === "Literal" && - typeof stmt.expression.value === "string" && - (!stmt.expression.extra || !stmt.expression.extra.parenthesized); - }; - }); - - instance.extend("parseBlockBody", function (inner) { - return function (node, ...args) { - inner.call(this, node, ...args); - - node.directives.reverse().forEach((directive) => { - node.body.unshift(this.directiveToStmt(directive)); - }); - delete node.directives; - }; - }); - - instance.extend("parseClassMethod", function (inner) { - return function (classBody, ...args) { - inner.call(this, classBody, ...args); - - const body = classBody.body; - body[body.length - 1].type = "MethodDefinition"; - }; - }); - - instance.extend("parseExprAtom", function(inner) { - return function (...args) { - switch (this.state.type) { - case tt.regexp: - return this.estreeParseRegExpLiteral(this.state.value); - - case tt.num: - case tt.string: - return this.estreeParseLiteral(this.state.value); - - case tt._null: - return this.estreeParseLiteral(null); - - case tt._true: - return this.estreeParseLiteral(true); - - case tt._false: - return this.estreeParseLiteral(false); - - default: - return inner.call(this, ...args); - } - }; - }); + node.directives.reverse().forEach((directive) => { + node.body.unshift(this.directiveToStmt(directive)); + }); + delete node.directives; + } - instance.extend("parseLiteral", function(inner) { - return function (...args) { - const node = inner.call(this, ...args); - node.raw = node.extra.raw; - delete node.extra; + parseClassMethod(classBody, ...args) { + super.parseClassMethod(classBody, ...args); - return node; - }; - }); + const body = classBody.body; + body[body.length - 1].type = "MethodDefinition"; + } - instance.extend("parseMethod", function(inner) { - return function (node, ...args) { - let funcNode = this.startNode(); - funcNode.kind = node.kind; // provide kind, so inner method correctly sets state - funcNode = inner.call(this, funcNode, ...args); - delete funcNode.kind; - node.value = this.finishNode(funcNode, "FunctionExpression"); + parseExprAtom(...args) { + switch (this.state.type) { + case tt.regexp: + return this.estreeParseRegExpLiteral(this.state.value); - return node; - }; - }); + case tt.num: + case tt.string: + return this.estreeParseLiteral(this.state.value); - instance.extend("parseObjectMethod", function(inner) { - return function (...args) { - const node = inner.call(this, ...args); + case tt._null: + return this.estreeParseLiteral(null); - if (node) { - if (node.kind === "method") node.kind = "init"; - node.type = "Property"; - } + case tt._true: + return this.estreeParseLiteral(true); - return node; - }; - }); + case tt._false: + return this.estreeParseLiteral(false); - instance.extend("parseObjectProperty", function(inner) { - return function (...args) { - const node = inner.call(this, ...args); + default: + return super.parseExprAtom(...args); + } + } - if (node) { - node.kind = "init"; - node.type = "Property"; - } + parseLiteral(...args) { + const node = super.parseLiteral(...args); + node.raw = node.extra.raw; + delete node.extra; + + return node; + } + + parseMethod(node, ...args) { + let funcNode = this.startNode(); + funcNode.kind = node.kind; // provide kind, so super method correctly sets state + funcNode = super.parseMethod(funcNode, ...args); + delete funcNode.kind; + node.value = this.finishNode(funcNode, "FunctionExpression"); + + return node; + } + + parseObjectMethod(...args) { + const node = super.parseObjectMethod(...args); + + if (node) { + if (node.kind === "method") node.kind = "init"; + node.type = "Property"; + } + + return node; + } + + parseObjectProperty(...args) { + const node = super.parseObjectProperty(...args); + + if (node) { + node.kind = "init"; + node.type = "Property"; + } + + return node; + } + + toAssignable(node, isBinding, ...args) { + if (isSimpleProperty(node)) { + this.toAssignable(node.value, isBinding, ...args); return node; - }; - }); - - instance.extend("toAssignable", function(inner) { - return function (node, isBinding, ...args) { - if (isSimpleProperty(node)) { - this.toAssignable(node.value, isBinding, ...args); - - return node; - } else if (node.type === "ObjectExpression") { - node.type = "ObjectPattern"; - for (const prop of (node.properties: Array)) { - if (prop.kind === "get" || prop.kind === "set") { - this.raise(prop.key.start, "Object pattern can't contain getter or setter"); - } else if (prop.method) { - this.raise(prop.key.start, "Object pattern can't contain methods"); - } else { - this.toAssignable(prop, isBinding, "object destructuring pattern"); - } + } else if (node.type === "ObjectExpression") { + node.type = "ObjectPattern"; + for (const prop of (node.properties: Array)) { + if (prop.kind === "get" || prop.kind === "set") { + this.raise(prop.key.start, "Object pattern can't contain getter or setter"); + } else if (prop.method) { + this.raise(prop.key.start, "Object pattern can't contain methods"); + } else { + this.toAssignable(prop, isBinding, "object destructuring pattern"); } - - return node; } - return inner.call(this, node, isBinding, ...args); - }; - }); -} + return node; + } + + return super.toAssignable(node, isBinding, ...args); + } +}; diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 15302e40dd..2eed420119 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -865,498 +865,433 @@ pp.flowParseVariance = function() { return variance; }; -export default function (instance) { +export default (superClass) => class extends superClass { // plain function return types: function name(): string {} - instance.extend("parseFunctionBody", function (inner) { - return function (node, allowExpression) { - if (this.match(tt.colon) && !allowExpression) { - // if allowExpression is true then we're parsing an arrow function and if - // there's a return type then it's been handled elsewhere - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - - node.returnType = typeNode.typeAnnotation - ? this.finishNode(typeNode, "TypeAnnotation") - : null; - } + parseFunctionBody(node, allowExpression) { + if (this.match(tt.colon) && !allowExpression) { + // if allowExpression is true then we're parsing an arrow function and if + // there's a return type then it's been handled elsewhere + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + + node.returnType = typeNode.typeAnnotation + ? this.finishNode(typeNode, "TypeAnnotation") + : null; + } - return inner.call(this, node, allowExpression); - }; - }); + return super.parseFunctionBody(node, allowExpression); + } // interfaces - instance.extend("parseStatement", function (inner) { - return function (declaration, topLevel) { - // strict mode handling of `interface` since it's a reserved word - if (this.state.strict && this.match(tt.name) && this.state.value === "interface") { - const node = this.startNode(); - this.next(); - return this.flowParseInterface(node); - } else { - return inner.call(this, declaration, topLevel); - } - }; - }); + parseStatement(declaration, topLevel) { + // strict mode handling of `interface` since it's a reserved word + if (this.state.strict && this.match(tt.name) && this.state.value === "interface") { + const node = this.startNode(); + this.next(); + return this.flowParseInterface(node); + } else { + return super.parseStatement(declaration, topLevel); + } + } // declares, interfaces and type aliases - instance.extend("parseExpressionStatement", function (inner) { - return function (node, expr) { - if (expr.type === "Identifier") { - if (expr.name === "declare") { - if (this.match(tt._class) || this.match(tt.name) || this.match(tt._function) || this.match(tt._var)) { - return this.flowParseDeclare(node); - } - } else if (this.match(tt.name)) { - if (expr.name === "interface") { - return this.flowParseInterface(node); - } else if (expr.name === "type") { - return this.flowParseTypeAlias(node); - } + parseExpressionStatement(node, expr) { + if (expr.type === "Identifier") { + if (expr.name === "declare") { + if (this.match(tt._class) || this.match(tt.name) || this.match(tt._function) || this.match(tt._var)) { + return this.flowParseDeclare(node); + } + } else if (this.match(tt.name)) { + if (expr.name === "interface") { + return this.flowParseInterface(node); + } else if (expr.name === "type") { + return this.flowParseTypeAlias(node); } } + } - return inner.call(this, node, expr); - }; - }); + return super.parseExpressionStatement(node, expr); + } // export type - instance.extend("shouldParseExportDeclaration", function (inner) { - return function () { - return this.isContextual("type") - || this.isContextual("interface") - || inner.call(this); - }; - }); - - instance.extend("parseConditional", function (inner) { - return function (expr, noIn, startPos, startLoc, refNeedsArrowPos) { - // only do the expensive clone if there is a question mark - // and if we come from inside parens - if (refNeedsArrowPos && this.match(tt.question)) { - const state = this.state.clone(); - try { - return inner.call(this, expr, noIn, startPos, startLoc); - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - refNeedsArrowPos.start = err.pos || this.state.start; - return expr; - } else { - // istanbul ignore next: no such error is expected - throw err; - } + shouldParseExportDeclaration() { + return this.isContextual("type") + || this.isContextual("interface") + || super.shouldParseExportDeclaration(); + } + + parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) { + // only do the expensive clone if there is a question mark + // and if we come from inside parens + if (refNeedsArrowPos && this.match(tt.question)) { + const state = this.state.clone(); + try { + return super.parseConditional(expr, noIn, startPos, startLoc); + } catch (err) { + if (err instanceof SyntaxError) { + this.state = state; + refNeedsArrowPos.start = err.pos || this.state.start; + return expr; + } else { + // istanbul ignore next: no such error is expected + throw err; } } + } - return inner.call(this, expr, noIn, startPos, startLoc); - }; - }); + return super.parseConditional(expr, noIn, startPos, startLoc); + } - instance.extend("parseParenItem", function (inner) { - return function (node, startPos, startLoc) { - node = inner.call(this, node, startPos, startLoc); - if (this.eat(tt.question)) { - node.optional = true; - } + parseParenItem(node, startPos, startLoc) { + node = super.parseParenItem(node, startPos, startLoc); + if (this.eat(tt.question)) { + node.optional = true; + } - if (this.match(tt.colon)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); + if (this.match(tt.colon)) { + const typeCastNode = this.startNodeAt(startPos, startLoc); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TypeCastExpression"); - } + return this.finishNode(typeCastNode, "TypeCastExpression"); + } - return node; - }; - }); - - instance.extend("parseExport", function (inner) { - return function (node) { - node = inner.call(this, node); - if (node.type === "ExportNamedDeclaration") { - node.exportKind = node.exportKind || "value"; - } - return node; - }; - }); + return node; + } - instance.extend("parseExportDeclaration", function (inner) { - return function (node) { - if (this.isContextual("type")) { - node.exportKind = "type"; + parseExport(node) { + node = super.parseExport(node); + if (node.type === "ExportNamedDeclaration") { + node.exportKind = node.exportKind || "value"; + } + return node; + } - const declarationNode = this.startNode(); - this.next(); + parseExportDeclaration(node) { + if (this.isContextual("type")) { + node.exportKind = "type"; - if (this.match(tt.braceL)) { - // export type { foo, bar }; - node.specifiers = this.parseExportSpecifiers(); - this.parseExportFrom(node); - return null; - } else { - // export type Foo = Bar; - return this.flowParseTypeAlias(declarationNode); - } - } else if (this.isContextual("interface")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseInterface(declarationNode); + const declarationNode = this.startNode(); + this.next(); + + if (this.match(tt.braceL)) { + // export type { foo, bar }; + node.specifiers = this.parseExportSpecifiers(); + this.parseExportFrom(node); + return null; } else { - return inner.call(this, node); + // export type Foo = Bar; + return this.flowParseTypeAlias(declarationNode); } - }; - }); + } else if (this.isContextual("interface")) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseInterface(declarationNode); + } else { + return super.parseExportDeclaration(node); + } + } - instance.extend("parseClassId", function (inner) { - return function (node) { - inner.apply(this, arguments); - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - }; - }); + parseClassId(node, ...args) { + super.parseClassId(node, ...args); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + } // don't consider `void` to be a keyword as then it'll use the void token type // and set startExpr - instance.extend("isKeyword", function (inner) { - return function (name) { - if (this.state.inType && name === "void") { - return false; - } else { - return inner.call(this, name); - } - }; - }); + isKeyword(name) { + if (this.state.inType && name === "void") { + return false; + } else { + return super.isKeyword(name); + } + } // ensure that inside flow types, we bypass the jsx parser plugin - instance.extend("readToken", function (inner) { - return function (code) { - if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(tt.relational, 1); - } else { - return inner.call(this, code); - } - }; - }); + readToken(code) { + if (this.state.inType && (code === 62 || code === 60)) { + return this.finishOp(tt.relational, 1); + } else { + return super.readToken(code); + } + } // don't lex any token as a jsx one inside a flow type - instance.extend("jsx_readToken", function (inner) { - return function () { - if (!this.state.inType) return inner.call(this); - }; - }); - - instance.extend("toAssignable", function (inner) { - return function (node, isBinding, contextDescription) { - if (node.type === "TypeCastExpression") { - return inner.call(this, this.typeCastToParameter(node), isBinding, contextDescription); - } else { - return inner.call(this, node, isBinding, contextDescription); - } - }; - }); + jsx_readToken() { + if (!this.state.inType) return super.jsx_readToken(); + } + + toAssignable(node, isBinding, contextDescription) { + if (node.type === "TypeCastExpression") { + return super.toAssignable(this.typeCastToParameter(node), isBinding, contextDescription); + } else { + return super.toAssignable(node, isBinding, contextDescription); + } + } // turn type casts that we found in function parameter head into type annotated params - instance.extend("toAssignableList", function (inner) { - return function (exprList, isBinding, contextDescription) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - if (expr && expr.type === "TypeCastExpression") { - exprList[i] = this.typeCastToParameter(expr); - } + toAssignableList(exprList, isBinding, contextDescription) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + if (expr && expr.type === "TypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); } - return inner.call(this, exprList, isBinding, contextDescription); - }; - }); + } + return super.toAssignableList(exprList, isBinding, contextDescription); + } // this is a list of nodes, from something like a call expression, we need to filter the // type casts that we've found that are illegal in this context - instance.extend("toReferencedList", function () { - return function (exprList) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - if (expr && expr._exprListItem && expr.type === "TypeCastExpression") { - this.raise(expr.start, "Unexpected type cast"); - } + toReferencedList(exprList) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + if (expr && expr._exprListItem && expr.type === "TypeCastExpression") { + this.raise(expr.start, "Unexpected type cast"); } + } - return exprList; - }; - }); + return exprList; + } // parse an item inside a expression list eg. `(NODE, NODE)` where NODE represents // the position where this function is called - instance.extend("parseExprListItem", function (inner) { - return function (...args) { - const container = this.startNode(); - const node = inner.call(this, ...args); - if (this.match(tt.colon)) { - container._exprListItem = true; - container.expression = node; - container.typeAnnotation = this.flowParseTypeAnnotation(); - return this.finishNode(container, "TypeCastExpression"); - } else { - return node; - } - }; - }); + parseExprListItem(...args) { + const container = this.startNode(); + const node = super.parseExprListItem(...args); + if (this.match(tt.colon)) { + container._exprListItem = true; + container.expression = node; + container.typeAnnotation = this.flowParseTypeAnnotation(); + return this.finishNode(container, "TypeCastExpression"); + } else { + return node; + } + } - instance.extend("checkLVal", function (inner) { - return function (node) { - if (node.type !== "TypeCastExpression") { - return inner.apply(this, arguments); - } - }; - }); + checkLVal(node, ...args) { + if (node.type !== "TypeCastExpression") { + return super.checkLVal(node, ...args); + } + } // parse class property type annotations - instance.extend("parseClassProperty", function (inner) { - return function (node) { - if (this.match(tt.colon)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - return inner.call(this, node); - }; - }); + parseClassProperty(node) { + if (this.match(tt.colon)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + return super.parseClassProperty(node); + } // determine whether or not we're currently in the position where a class method would appear - instance.extend("isClassMethod", function (inner) { - return function () { - return this.isRelational("<") || inner.call(this); - }; - }); + isClassMethod() { + return this.isRelational("<") || super.isClassMethod(); + } // determine whether or not we're currently in the position where a class property would appear - instance.extend("isClassProperty", function (inner) { - return function () { - return this.match(tt.colon) || inner.call(this); - }; - }); + isClassProperty() { + return this.match(tt.colon) || super.isClassProperty(); + } // parse type parameters for class methods - instance.extend("parseClassMethod", function (inner) { - return function (classBody, method, ...args) { - if (method.variance) { - this.unexpected(method.variance.start); - } - delete method.variance; - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } + parseClassMethod(classBody, method, ...args) { + if (method.variance) { + this.unexpected(method.variance.start); + } + delete method.variance; + if (this.isRelational("<")) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } - inner.call(this, classBody, method, ...args); - }; - }); + super.parseClassMethod(classBody, method, ...args); + } // parse a the super class type parameters and implements - instance.extend("parseClassSuper", function (inner) { - return function (node, isStatement) { - inner.call(this, node, isStatement); - if (node.superClass && this.isRelational("<")) { - node.superTypeParameters = this.flowParseTypeParameterInstantiation(); - } - if (this.isContextual("implements")) { - this.next(); - const implemented = node.implements = []; - do { - const node = this.startNode(); - node.id = this.parseIdentifier(); - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - implemented.push(this.finishNode(node, "ClassImplements")); - } while (this.eat(tt.comma)); - } - }; - }); - - instance.extend("parsePropertyName", function (inner) { - return function (node) { - const variance = this.flowParseVariance(); - const key = inner.call(this, node); - node.variance = variance; - return key; - }; - }); + parseClassSuper(node, isStatement) { + super.parseClassSuper(node, isStatement); + if (node.superClass && this.isRelational("<")) { + node.superTypeParameters = this.flowParseTypeParameterInstantiation(); + } + if (this.isContextual("implements")) { + this.next(); + const implemented = node.implements = []; + do { + const node = this.startNode(); + node.id = this.parseIdentifier(); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + implemented.push(this.finishNode(node, "ClassImplements")); + } while (this.eat(tt.comma)); + } + } - // parse type parameters for object method shorthand - instance.extend("parseObjPropValue", function (inner) { - return function (prop) { - if (prop.variance) { - this.unexpected(prop.variance.start); - } - delete prop.variance; + parsePropertyName(node) { + const variance = this.flowParseVariance(); + const key = super.parsePropertyName(node); + node.variance = variance; + return key; + } - let typeParameters; + // parse type parameters for object method shorthand + parseObjPropValue(prop, ...args) { + if (prop.variance) { + this.unexpected(prop.variance.start); + } + delete prop.variance; - // method shorthand - if (this.isRelational("<")) { - typeParameters = this.flowParseTypeParameterDeclaration(); - if (!this.match(tt.parenL)) this.unexpected(); - } + let typeParameters; - inner.apply(this, arguments); + // method shorthand + if (this.isRelational("<")) { + typeParameters = this.flowParseTypeParameterDeclaration(); + if (!this.match(tt.parenL)) this.unexpected(); + } - // add typeParameters if we found them - if (typeParameters) { - (prop.value || prop).typeParameters = typeParameters; - } - }; - }); + super.parseObjPropValue(prop, ...args); - instance.extend("parseAssignableListItemTypes", function () { - return function (param) { - if (this.eat(tt.question)) { - param.optional = true; - } - if (this.match(tt.colon)) { - param.typeAnnotation = this.flowParseTypeAnnotation(); - } - this.finishNode(param, param.type); - return param; - }; - }); + // add typeParameters if we found them + if (typeParameters) { + (prop.value || prop).typeParameters = typeParameters; + } + } - instance.extend("parseMaybeDefault", function (inner) { - return function (...args) { - const node = inner.apply(this, args); + parseAssignableListItemTypes(param) { + if (this.eat(tt.question)) { + param.optional = true; + } + if (this.match(tt.colon)) { + param.typeAnnotation = this.flowParseTypeAnnotation(); + } + this.finishNode(param, param.type); + return param; + } - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`"); - } + parseMaybeDefault(...args) { + const node = super.parseMaybeDefault(...args); - return node; - }; - }); + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`"); + } + return node; + } // parse typeof and type imports - instance.extend("parseImportSpecifiers", function (inner) { - return function (node) { - node.importKind = "value"; - - let kind = null; - if (this.match(tt._typeof)) { - kind = "typeof"; - } else if (this.isContextual("type")) { - kind = "type"; - } - if (kind) { - const lh = this.lookahead(); - if ((lh.type === tt.name && lh.value !== "from") || lh.type === tt.braceL || lh.type === tt.star) { - this.next(); - node.importKind = kind; - } + parseImportSpecifiers(node) { + node.importKind = "value"; + + let kind = null; + if (this.match(tt._typeof)) { + kind = "typeof"; + } else if (this.isContextual("type")) { + kind = "type"; + } + if (kind) { + const lh = this.lookahead(); + if ((lh.type === tt.name && lh.value !== "from") || lh.type === tt.braceL || lh.type === tt.star) { + this.next(); + node.importKind = kind; } + } - inner.call(this, node); - }; - }); + super.parseImportSpecifiers(node); + } // parse import-type/typeof shorthand - instance.extend("parseImportSpecifier", function () { - return function (node) { - const specifier = this.startNode(); - const firstIdentLoc = this.state.start; - const firstIdent = this.parseIdentifier(true); - - let specifierTypeKind = null; - if (firstIdent.name === "type") { - specifierTypeKind = "type"; - } else if (firstIdent.name === "typeof") { - specifierTypeKind = "typeof"; - } + parseImportSpecifier(node) { + const specifier = this.startNode(); + const firstIdentLoc = this.state.start; + const firstIdent = this.parseIdentifier(true); + + let specifierTypeKind = null; + if (firstIdent.name === "type") { + specifierTypeKind = "type"; + } else if (firstIdent.name === "typeof") { + specifierTypeKind = "typeof"; + } - let isBinding = false; - if (this.isContextual("as")) { - const as_ident = this.parseIdentifier(true); - if (specifierTypeKind !== null && !this.match(tt.name) && !this.state.type.keyword) { - // `import {type as ,` or `import {type as }` - specifier.imported = as_ident; - specifier.importKind = specifierTypeKind; - specifier.local = as_ident.__clone(); - } else { - // `import {type as foo` - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = this.parseIdentifier(); - } - } else if (specifierTypeKind !== null && (this.match(tt.name) || this.state.type.keyword)) { - // `import {type foo` - specifier.imported = this.parseIdentifier(true); + let isBinding = false; + if (this.isContextual("as")) { + const as_ident = this.parseIdentifier(true); + if (specifierTypeKind !== null && !this.match(tt.name) && !this.state.type.keyword) { + // `import {type as ,` or `import {type as }` + specifier.imported = as_ident; specifier.importKind = specifierTypeKind; - if (this.eatContextual("as")) { - specifier.local = this.parseIdentifier(); - } else { - isBinding = true; - specifier.local = specifier.imported.__clone(); - } + specifier.local = as_ident.__clone(); } else { - isBinding = true; + // `import {type as foo` specifier.imported = firstIdent; specifier.importKind = null; + specifier.local = this.parseIdentifier(); + } + } else if (specifierTypeKind !== null && (this.match(tt.name) || this.state.type.keyword)) { + // `import {type foo` + specifier.imported = this.parseIdentifier(true); + specifier.importKind = specifierTypeKind; + if (this.eatContextual("as")) { + specifier.local = this.parseIdentifier(); + } else { + isBinding = true; specifier.local = specifier.imported.__clone(); } + } else { + isBinding = true; + specifier.imported = firstIdent; + specifier.importKind = null; + specifier.local = specifier.imported.__clone(); + } - if ( - (node.importKind === "type" || node.importKind === "typeof") && - (specifier.importKind === "type" || specifier.importKind === "typeof") - ) { - this.raise(firstIdentLoc, "`The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements`"); - } + if ( + (node.importKind === "type" || node.importKind === "typeof") && + (specifier.importKind === "type" || specifier.importKind === "typeof") + ) { + this.raise(firstIdentLoc, "`The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements`"); + } - if (isBinding) this.checkReservedWord(specifier.local.name, specifier.start, true, true); + if (isBinding) this.checkReservedWord(specifier.local.name, specifier.start, true, true); - this.checkLVal(specifier.local, true, undefined, "import specifier"); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); - }; - }); + this.checkLVal(specifier.local, true, undefined, "import specifier"); + node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); + } // parse function type parameters - function foo() {} - instance.extend("parseFunctionParams", function (inner) { - return function (node) { - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - inner.call(this, node); - }; - }); + parseFunctionParams(node) { + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.parseFunctionParams(node); + } // parse flow type annotations on variable declarator heads - let foo: string = bar - instance.extend("parseVarHead", function (inner) { - return function (decl) { - inner.call(this, decl); - if (this.match(tt.colon)) { - decl.id.typeAnnotation = this.flowParseTypeAnnotation(); - this.finishNode(decl.id, decl.id.type); - } - }; - }); + parseVarHead(decl) { + super.parseVarHead(decl); + if (this.match(tt.colon)) { + decl.id.typeAnnotation = this.flowParseTypeAnnotation(); + this.finishNode(decl.id, decl.id.type); + } + } // parse the return type of an async arrow function - let foo = (async (): number => {}); - instance.extend("parseAsyncArrowFromCallExpression", function (inner) { - return function (node, call) { - if (this.match(tt.colon)) { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - node.returnType = this.flowParseTypeAnnotation(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - } + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(tt.colon)) { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + node.returnType = this.flowParseTypeAnnotation(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + } - return inner.call(this, node, call); - }; - }); + return super.parseAsyncArrowFromCallExpression(node, call); + } // todo description - instance.extend("shouldParseAsyncArrow", function (inner) { - return function () { - return this.match(tt.colon) || inner.call(this); - }; - }); + shouldParseAsyncArrow() { + return this.match(tt.colon) || super.shouldParseAsyncArrow(); + } // We need to support type parameter declarations for arrow functions. This // is tricky. There are three situations we need to handle @@ -1367,99 +1302,93 @@ export default function (instance) { // 2. This is an arrow function. We'll parse the type parameter declaration, // parse the rest, make sure the rest is an arrow function, and go from // there - // 3. This is neither. Just call the inner function - instance.extend("parseMaybeAssign", function (inner) { - return function (...args) { - let jsxError = null; - if (tt.jsxTagStart && this.match(tt.jsxTagStart)) { - const state = this.state.clone(); - try { - return inner.apply(this, args); - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - jsxError = err; - } else { - // istanbul ignore next: no such error is expected - throw err; - } + // 3. This is neither. Just call the super method + parseMaybeAssign(...args) { + let jsxError = null; + if (tt.jsxTagStart && this.match(tt.jsxTagStart)) { + const state = this.state.clone(); + try { + return super.parseMaybeAssign(...args); + } catch (err) { + if (err instanceof SyntaxError) { + this.state = state; + jsxError = err; + } else { + // istanbul ignore next: no such error is expected + throw err; } } + } - if (jsxError != null || this.isRelational("<")) { - // Need to push something onto the context to stop - // the JSX plugin from messing with the tokens - this.state.context.push(ct.parenExpression); - let arrowExpression; - let typeParameters; - try { - typeParameters = this.flowParseTypeParameterDeclaration(); - - arrowExpression = inner.apply(this, args); - arrowExpression.typeParameters = typeParameters; - this.resetStartLocationFromNode(arrowExpression, typeParameters); - } catch (err) { - this.state.context.pop(); - - throw jsxError || err; - } + if (jsxError != null || this.isRelational("<")) { + // Need to push something onto the context to stop + // the JSX plugin from messing with the tokens + this.state.context.push(ct.parenExpression); + let arrowExpression; + let typeParameters; + try { + typeParameters = this.flowParseTypeParameterDeclaration(); + arrowExpression = super.parseMaybeAssign(...args); + arrowExpression.typeParameters = typeParameters; + this.resetStartLocationFromNode(arrowExpression, typeParameters); + } catch (err) { this.state.context.pop(); - if (arrowExpression.type === "ArrowFunctionExpression") { - return arrowExpression; - } else if (jsxError != null) { - throw jsxError; - } else { - this.raise( - typeParameters.start, - "Expected an arrow function after this type parameter declaration", - ); - } + throw jsxError || err; } - return inner.apply(this, args); - }; - }); + this.state.context.pop(); + + if (arrowExpression.type === "ArrowFunctionExpression") { + return arrowExpression; + } else if (jsxError != null) { + throw jsxError; + } else { + this.raise( + typeParameters.start, + "Expected an arrow function after this type parameter declaration", + ); + } + } + + return super.parseMaybeAssign(...args); + } // handle return types for arrow functions - instance.extend("parseArrow", function (inner) { - return function (node) { - if (this.match(tt.colon)) { - const state = this.state.clone(); - try { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - - this.state.noAnonFunctionType = oldNoAnonFunctionType; - - if (this.canInsertSemicolon()) this.unexpected(); - if (!this.match(tt.arrow)) this.unexpected(); - - // assign after it is clear it is an arrow - node.returnType = typeNode.typeAnnotation - ? this.finishNode(typeNode, "TypeAnnotation") - : null; - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - } else { - // istanbul ignore next: no such error is expected - throw err; - } + parseArrow(node) { + if (this.match(tt.colon)) { + const state = this.state.clone(); + try { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + + this.state.noAnonFunctionType = oldNoAnonFunctionType; + + if (this.canInsertSemicolon()) this.unexpected(); + if (!this.match(tt.arrow)) this.unexpected(); + + // assign after it is clear it is an arrow + node.returnType = typeNode.typeAnnotation + ? this.finishNode(typeNode, "TypeAnnotation") + : null; + } catch (err) { + if (err instanceof SyntaxError) { + this.state = state; + } else { + // istanbul ignore next: no such error is expected + throw err; } } + } - return inner.call(this, node); - }; - }); + return super.parseArrow(node); + } - instance.extend("shouldParseArrow", function (inner) { - return function () { - return this.match(tt.colon) || inner.call(this); - }; - }); -} + shouldParseArrow() { + return this.match(tt.colon) || super.shouldParseArrow(); + } +}; diff --git a/src/plugins/jsx/index.js b/src/plugins/jsx/index.js index 49231318f4..7309fa9121 100644 --- a/src/plugins/jsx/index.js +++ b/src/plugins/jsx/index.js @@ -395,72 +395,66 @@ pp.jsxParseElement = function() { return this.jsxParseElementAt(startPos, startLoc); }; -export default function(instance) { - instance.extend("parseExprAtom", function(inner) { - return function(refShortHandDefaultPos) { - if (this.match(tt.jsxText)) { - return this.parseLiteral(this.state.value, "JSXText"); - } else if (this.match(tt.jsxTagStart)) { - return this.jsxParseElement(); - } else { - return inner.call(this, refShortHandDefaultPos); - } - }; - }); - - instance.extend("readToken", function(inner) { - return function(code) { - if (this.state.inPropertyName) return inner.call(this, code); - - const context = this.curContext(); +export default (superClass) => class extends superClass { + parseExprAtom(refShortHandDefaultPos) { + if (this.match(tt.jsxText)) { + return this.parseLiteral(this.state.value, "JSXText"); + } else if (this.match(tt.jsxTagStart)) { + return this.jsxParseElement(); + } else { + return super.parseExprAtom(refShortHandDefaultPos); + } + } - if (context === tc.j_expr) { - return this.jsxReadToken(); - } + readToken(code) { + if (this.state.inPropertyName) return super.readToken(code); - if (context === tc.j_oTag || context === tc.j_cTag) { - if (isIdentifierStart(code)) { - return this.jsxReadWord(); - } + const context = this.curContext(); - if (code === 62) { - ++this.state.pos; - return this.finishToken(tt.jsxTagEnd); - } + if (context === tc.j_expr) { + return this.jsxReadToken(); + } - if ((code === 34 || code === 39) && context === tc.j_oTag) { - return this.jsxReadString(code); - } + if (context === tc.j_oTag || context === tc.j_cTag) { + if (isIdentifierStart(code)) { + return this.jsxReadWord(); } - if (code === 60 && this.state.exprAllowed) { + if (code === 62) { ++this.state.pos; - return this.finishToken(tt.jsxTagStart); + return this.finishToken(tt.jsxTagEnd); } - return inner.call(this, code); - }; - }); - - instance.extend("updateContext", function(inner) { - return function(prevType) { - if (this.match(tt.braceL)) { - const curContext = this.curContext(); - if (curContext === tc.j_oTag) { - this.state.context.push(tc.braceExpression); - } else if (curContext === tc.j_expr) { - this.state.context.push(tc.templateQuasi); - } else { - inner.call(this, prevType); - } - this.state.exprAllowed = true; - } else if (this.match(tt.slash) && prevType === tt.jsxTagStart) { - this.state.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore - this.state.context.push(tc.j_cTag); // reconsider as closing tag context - this.state.exprAllowed = false; + if ((code === 34 || code === 39) && context === tc.j_oTag) { + return this.jsxReadString(code); + } + } + + if (code === 60 && this.state.exprAllowed) { + ++this.state.pos; + return this.finishToken(tt.jsxTagStart); + } + + return super.readToken(code); + } + + updateContext(prevType) { + if (this.match(tt.braceL)) { + const curContext = this.curContext(); + if (curContext === tc.j_oTag) { + this.state.context.push(tc.braceExpression); + } else if (curContext === tc.j_expr) { + this.state.context.push(tc.templateQuasi); } else { - return inner.call(this, prevType); + super.updateContext(prevType); } - }; - }); -} + this.state.exprAllowed = true; + } else if (this.match(tt.slash) && prevType === tt.jsxTagStart) { + this.state.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore + this.state.context.push(tc.j_cTag); // reconsider as closing tag context + this.state.exprAllowed = false; + } else { + return super.updateContext(prevType); + } + } +}; From 5e156310ca303a2c32d455f385a03ee51b4ff22b Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 21 Apr 2017 05:25:31 -0700 Subject: [PATCH 085/105] Type-check tokenizer/index.js (#460) * Type-check tokenizer/index.js * Update test baselines --- src/tokenizer/index.js | 105 ++++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 42 deletions(-) diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index 076b636381..b9137487ef 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -1,9 +1,13 @@ /* eslint max-len: 0 */ +// @flow + import type { TokenType } from "./types"; +import type { Options } from "../options"; +import type { Position } from "../util/location"; import { isIdentifierStart, isIdentifierChar, isKeyword } from "../util/identifier"; import { types as tt, keywords as keywordTypes } from "./types"; -import { types as ct } from "./context"; +import { type TokContext, types as ct } from "./context"; import { SourceLocation } from "../util/location"; import { lineBreak, lineBreakG, isNewLine, nonASCIIwhitespace } from "../util/whitespace"; import State from "./state"; @@ -13,7 +17,7 @@ import State from "./state"; // used for the onToken callback and the external tokenizer. export class Token { - constructor(state) { + constructor(state: State) { this.type = state.type; this.value = state.value; this.start = state.start; @@ -30,7 +34,7 @@ export class Token { // ## Tokenizer -function codePointToString(code) { +function codePointToString(code: number): string { // UTF-16 Decoding if (code <= 0xFFFF) { return String.fromCharCode(code); @@ -40,14 +44,28 @@ function codePointToString(code) { } export default class Tokenizer { - constructor(options, input) { + // Forward-declarations + // location.js + +raise: (pos: number, message: string) => empty; + // comments.js (TODO: Better type for the parameter) + +addComment: (comment: Object) => void; + // parser/index.js + +hasPlugin: (name: string) => boolean; + // parser/util.js + +unexpected: (pos?: ?number, messageOrType?: string | TokenType) => empty; + + state: State; + isLookahead: boolean; + input: string; + + constructor(options: Options, input: string) { this.state = new State; this.state.init(options, input); } // Move to the next token - next() { + next(): void { if (!this.isLookahead) { this.state.tokens.push(new Token(this.state)); } @@ -61,7 +79,7 @@ export default class Tokenizer { // TODO - eat(type) { + eat(type: TokenType): boolean { if (this.match(type)) { this.next(); return true; @@ -72,19 +90,19 @@ export default class Tokenizer { // TODO - match(type) { + match(type: TokenType): boolean { return this.state.type === type; } // TODO - isKeyword(word) { + isKeyword(word: string): boolean { return isKeyword(word); } // TODO - lookahead() { + lookahead(): State { const old = this.state; this.state = old.clone(true); @@ -100,7 +118,7 @@ export default class Tokenizer { // Toggle strict mode. Re-reads the next number or string to please // pedantic tests (`"use strict"; 010;` should fail). - setStrict(strict) { + setStrict(strict: boolean): void { this.state.strict = strict; if (!this.match(tt.num) && !this.match(tt.string)) return; this.state.pos = this.state.start; @@ -111,14 +129,14 @@ export default class Tokenizer { this.nextToken(); } - curContext() { + curContext(): TokContext { return this.state.context[this.state.context.length - 1]; } // Read a single token, updating the parser object's token-related // properties. - nextToken() { + nextToken(): void { const curContext = this.curContext(); if (!curContext || !curContext.preserveSpace) this.skipSpace(); @@ -135,7 +153,7 @@ export default class Tokenizer { } } - readToken(code) { + readToken(code: number): void { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. if (isIdentifierStart(code) || code === 92 /* '\' */) { @@ -145,7 +163,7 @@ export default class Tokenizer { } } - fullCharCodeAtPos() { + fullCharCodeAtPos(): number { const code = this.input.charCodeAt(this.state.pos); if (code <= 0xd7ff || code >= 0xe000) return code; @@ -153,7 +171,7 @@ export default class Tokenizer { return (code << 10) + next - 0x35fdc00; } - pushComment(block, text, start, end, startLoc, endLoc) { + pushComment(block: boolean, text: string, start: number, end: number, startLoc: Position, endLoc: Position): void { const comment = { type: block ? "CommentBlock" : "CommentLine", value: text, @@ -169,7 +187,7 @@ export default class Tokenizer { } } - skipBlockComment() { + skipBlockComment(): void { const startLoc = this.state.curPosition(); const start = this.state.pos; const end = this.input.indexOf("*/", this.state.pos += 2); @@ -186,7 +204,7 @@ export default class Tokenizer { this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); } - skipLineComment(startSkip) { + skipLineComment(startSkip: number): void { const start = this.state.pos; const startLoc = this.state.curPosition(); let ch = this.input.charCodeAt(this.state.pos += startSkip); @@ -201,7 +219,7 @@ export default class Tokenizer { // Called at the start of the parse and after every token. Skips // whitespace and comments, and. - skipSpace() { + skipSpace(): void { loop: while (this.state.pos < this.input.length) { const ch = this.input.charCodeAt(this.state.pos); switch (ch) { @@ -250,7 +268,7 @@ export default class Tokenizer { // the token, so that the next one's `start` will point at the // right position. - finishToken(type, val) { + finishToken(type: TokenType, val: any): void { this.state.end = this.state.pos; this.state.endLoc = this.state.curPosition(); const prevType = this.state.type; @@ -269,7 +287,7 @@ export default class Tokenizer { // // All in the name of speed. // - readToken_dot() { + readToken_dot(): void { const next = this.input.charCodeAt(this.state.pos + 1); if (next >= 48 && next <= 57) { return this.readNumber(true); @@ -285,7 +303,7 @@ export default class Tokenizer { } } - readToken_slash() { // '/' + readToken_slash(): void { // '/' if (this.state.exprAllowed) { ++this.state.pos; return this.readRegexp(); @@ -299,7 +317,7 @@ export default class Tokenizer { } } - readToken_mult_modulo(code) { // '%*' + readToken_mult_modulo(code: number): void { // '%*' let type = code === 42 ? tt.star : tt.modulo; let width = 1; let next = this.input.charCodeAt(this.state.pos + 1); @@ -318,7 +336,7 @@ export default class Tokenizer { return this.finishOp(type, width); } - readToken_pipe_amp(code) { // '|&' + readToken_pipe_amp(code: number): void { // '|&' const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) return this.finishOp(code === 124 ? tt.logicalOR : tt.logicalAND, 2); if (next === 61) return this.finishOp(tt.assign, 2); @@ -326,7 +344,7 @@ export default class Tokenizer { return this.finishOp(code === 124 ? tt.bitwiseOR : tt.bitwiseAND, 1); } - readToken_caret() { // '^' + readToken_caret(): void { // '^' const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { return this.finishOp(tt.assign, 2); @@ -335,7 +353,7 @@ export default class Tokenizer { } } - readToken_plus_min(code) { // '+-' + readToken_plus_min(code: number): void { // '+-' const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { @@ -355,7 +373,7 @@ export default class Tokenizer { } } - readToken_lt_gt(code) { // '<>' + readToken_lt_gt(code: number): void { // '<>' const next = this.input.charCodeAt(this.state.pos + 1); let size = 1; @@ -381,7 +399,7 @@ export default class Tokenizer { return this.finishOp(tt.relational, size); } - readToken_eq_excl(code) { // '=!' + readToken_eq_excl(code: number): void { // '=!' const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) return this.finishOp(tt.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); if (code === 61 && next === 62) { // '=>' @@ -391,7 +409,7 @@ export default class Tokenizer { return this.finishOp(code === 61 ? tt.eq : tt.prefix, 1); } - getTokenFromCode(code) { + getTokenFromCode(code: number): void { switch (code) { // The interpretation of a dot depends on whether it is followed // by a digit or another two dots. @@ -479,13 +497,13 @@ export default class Tokenizer { this.raise(this.state.pos, `Unexpected character '${codePointToString(code)}'`); } - finishOp(type, size) { + finishOp(type: TokenType, size: number): void { const str = this.input.slice(this.state.pos, this.state.pos + size); this.state.pos += size; return this.finishToken(type, str); } - readRegexp() { + readRegexp(): void { const start = this.state.pos; let escaped, inClass; for (;;) { @@ -527,7 +545,7 @@ export default class Tokenizer { // were read, the integer value otherwise. When `len` is given, this // will return `null` unless the integer has exactly `len` digits. - readInt(radix, len) { + readInt(radix: number, len?: number): number | null { const start = this.state.pos; let total = 0; @@ -552,7 +570,7 @@ export default class Tokenizer { return total; } - readRadixNumber(radix) { + readRadixNumber(radix: number): void { this.state.pos += 2; // 0x const val = this.readInt(radix); if (val == null) this.raise(this.state.start + 2, "Expected number in radix " + radix); @@ -562,7 +580,7 @@ export default class Tokenizer { // Read an integer, octal integer, or floating-point number. - readNumber(startsWithDot) { + readNumber(startsWithDot: boolean): void { const start = this.state.pos; const firstIsZero = this.input.charCodeAt(start) === 48; // '0' let isFloat = false; @@ -601,7 +619,7 @@ export default class Tokenizer { // Read a string value, interpreting backslash-escapes. - readCodePoint(throwOnInvalid) { + readCodePoint(throwOnInvalid: boolean): number | null { const ch = this.input.charCodeAt(this.state.pos); let code; @@ -625,7 +643,7 @@ export default class Tokenizer { return code; } - readString(quote) { + readString(quote: number): void { let out = "", chunkStart = ++this.state.pos; for (;;) { if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated string constant"); @@ -633,6 +651,7 @@ export default class Tokenizer { if (ch === quote) break; if (ch === 92) { // '\' out += this.input.slice(chunkStart, this.state.pos); + // $FlowFixMe out += this.readEscapedChar(false); chunkStart = this.state.pos; } else { @@ -646,7 +665,7 @@ export default class Tokenizer { // Reads template string tokens. - readTmplToken() { + readTmplToken(): void { let out = "", chunkStart = this.state.pos, containsInvalid = false; for (;;) { if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated template"); @@ -697,7 +716,7 @@ export default class Tokenizer { // Used to read escaped characters - readEscapedChar(inTemplate) { + readEscapedChar(inTemplate: boolean): string | null { const throwOnInvalid = !inTemplate; const ch = this.input.charCodeAt(++this.state.pos); ++this.state.pos; @@ -724,6 +743,7 @@ export default class Tokenizer { default: if (ch >= 48 && ch <= 55) { const codePos = this.state.pos - 1; + // $FlowFixMe let octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0]; let octal = parseInt(octalStr, 8); if (octal > 255) { @@ -752,7 +772,7 @@ export default class Tokenizer { // Used to read character escape sequences ('\x', '\u'). - readHexChar(len, throwOnInvalid) { + readHexChar(len: number, throwOnInvalid: boolean): number | null { const codePos = this.state.pos; const n = this.readInt(16, len); if (n === null) { @@ -772,7 +792,7 @@ export default class Tokenizer { // Incrementally adds only escaped chars, adding other chunks as-is // as a micro-optimization. - readWord1() { + readWord1(): string { this.state.containsEsc = false; let word = "", first = true, chunkStart = this.state.pos; while (this.state.pos < this.input.length) { @@ -795,6 +815,7 @@ export default class Tokenizer { this.raise(escStart, "Invalid Unicode escape"); } + // $FlowFixMe word += codePointToString(esc); chunkStart = this.state.pos; } else { @@ -808,7 +829,7 @@ export default class Tokenizer { // Read an identifier or keyword token. Will check for reserved // words when necessary. - readWord() { + readWord(): void { const word = this.readWord1(); let type = tt.name; if (!this.state.containsEsc && this.isKeyword(word)) { @@ -817,7 +838,7 @@ export default class Tokenizer { return this.finishToken(type, word); } - braceIsBlock(prevType) { + braceIsBlock(prevType: TokenType): boolean { if (prevType === tt.colon) { const parent = this.curContext(); if (parent === ct.braceStatement || parent === ct.braceExpression) { @@ -840,7 +861,7 @@ export default class Tokenizer { return !this.state.exprAllowed; } - updateContext(prevType) { + updateContext(prevType: TokenType): void { const type = this.state.type; let update; From 28ccd05bab93dc6b026b51f22850db942885951b Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 21 Apr 2017 14:26:30 +0200 Subject: [PATCH 086/105] =?UTF-8?q?Update=20flow-bin=20to=20the=20latest?= =?UTF-8?q?=20version=20=F0=9F=9A=80=20(#468)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update flow-bin to version 0.44.0 https://greenkeeper.io/ * Update yarn.lock --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3b00c3f6ff..3280a72a9a 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.20.0", - "flow-bin": "^0.43.0", + "flow-bin": "^0.44.0", "nyc": "^10.0.0", "rimraf": "^2.5.4", "rollup": "^0.41.0", diff --git a/yarn.lock b/yarn.lock index bf7311170c..f9d3433784 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1994,9 +1994,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.43.0: - version "0.43.1" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.43.1.tgz#0733958b448fb8ad4b1576add7e87c31794c81bc" +flow-bin@^0.44.0: + version "0.44.2" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.44.2.tgz#3893c7db5de043ed82674f327a04b1309db208b5" fn-name@^2.0.0: version "2.0.1" From d1a5220b89e7bf0aac65773fae28af88173880b2 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Fri, 21 Apr 2017 14:41:59 +0200 Subject: [PATCH 087/105] Add support for declare export + fixes (#224) * Add support for declare export * Do not allow declare module inside declare module * Reallow module exports outside module * Add handling of `declare export default` Add check for multiple module.export declarations * Disallow export let/const/type Refactor parsing object properties to share more code and add support for getters and setters * Rename tests * Update test fixtures * Optimize for performance * disallow declare export interface outside of module * Refactor code to be more readable and less lookahead * Add comments * Add test for export star as * Test for number literal getter/setter * Add more tests * Fix tests * Allow union types and correctly eat semi after type * Use non computed keys * Fix tests --- .gitignore | 1 + src/parser/statement.js | 3 +- src/plugins/flow.js | 226 ++++-- .../flow/call-properties/3/expected.json | 7 +- .../class-properties/getter-setter/actual.js | 8 + .../getter-setter/expected.json | 656 ++++++++++++++++++ .../invalid-getter-setter/actual.js | 3 + .../invalid-getter-setter/options.json | 3 + .../invalid-named-static/expected.json | 33 + .../named-static/expected.json | 7 +- .../declare-export/export-class/actual.js | 1 + .../declare-export/export-class/expected.json | 275 ++++++++ .../export-default-arrow/actual.js | 1 + .../export-default-arrow/expected.json | 132 ++++ .../export-default-class/actual.js | 1 + .../export-default-class/expected.json | 119 ++++ .../export-default-function/actual.js | 1 + .../export-default-function/expected.json | 180 +++++ .../export-default-union/actual.js | 1 + .../export-default-union/expected.json | 150 ++++ .../flow/declare-export/export-from/actual.js | 1 + .../declare-export/export-from/expected.json | 175 +++++ .../declare-export/export-function/actual.js | 1 + .../export-function/expected.json | 233 +++++++ .../export-interface-and-var/actual.js | 1 + .../export-interface-and-var/expected.json | 237 +++++++ .../export-interface-commonjs/actual.js | 1 + .../export-interface-commonjs/expected.json | 204 ++++++ .../declare-export/export-interface/actual.js | 1 + .../export-interface/expected.json | 159 +++++ .../export-named-pattern/actual.js | 1 + .../export-named-pattern/expected.json | 156 +++++ .../declare-export/export-star-as/actual.js | 1 + .../export-star-as/expected.json | 104 +++ .../export-star-as/options.json | 3 + .../flow/declare-export/export-star/actual.js | 1 + .../declare-export/export-star/expected.json | 122 ++++ .../export-type-and-var/actual.js | 1 + .../export-type-and-var/expected.json | 231 ++++++ .../export-type-commonjs/actual.js | 1 + .../export-type-commonjs/expected.json | 198 ++++++ .../flow/declare-export/export-type/actual.js | 1 + .../declare-export/export-type/expected.json | 153 ++++ .../flow/declare-export/export-var/actual.js | 1 + .../declare-export/export-var/expected.json | 165 +++++ .../invalid-declare-export-type/actual.js | 1 + .../invalid-declare-export-type/options.json | 3 + .../invalid-export-arrow/actual.js | 1 + .../invalid-export-arrow/options.json | 3 + .../invalid-export-const/actual.js | 1 + .../invalid-export-const/options.json | 3 + .../invalid-export-default-function/actual.js | 1 + .../options.json | 3 + .../invalid-export-default-var/actual.js | 1 + .../invalid-export-default-var/options.json | 3 + .../invalid-export-interface/actual.js | 1 + .../invalid-export-interface/options.json | 3 + .../invalid-export-let/actual.js | 1 + .../invalid-export-let/options.json | 3 + .../flow/declare-module/1/expected.json | 3 +- .../fixtures/flow/declare-module/10/actual.js | 1 + .../flow/declare-module/10/expected.json | 152 ++++ .../flow/declare-module/2/expected.json | 3 +- .../flow/declare-module/3/expected.json | 3 +- .../flow/declare-module/4/expected.json | 3 +- .../flow/declare-module/5/expected.json | 40 +- .../flow/declare-module/6/expected.json | 40 +- .../flow/declare-module/9/expected.json | 3 +- .../flow/declare-module/import/expected.json | 3 +- .../invalid-commonjs-module/actual.js | 1 + .../invalid-commonjs-module/options.json | 3 + .../invalid-es-module/actual.js | 1 + .../invalid-es-module/options.json | 3 + .../invalid-module-in-module/actual.js | 1 + .../invalid-module-in-module/options.json | 3 + .../invalid-multiple-commonjs/actual.js | 1 + .../invalid-multiple-commonjs/options.json | 3 + .../flow/declare-statements/10/expected.json | 44 +- .../flow/declare-statements/15/expected.json | 14 +- .../flow/declare-statements/17/expected.json | 21 +- .../flow/declare-statements/7/expected.json | 37 +- .../flow/declare-statements/9/expected.json | 7 +- .../invalid-literal/actual.js | 1 + .../invalid-literal/options.json | 3 + .../10/expected.json | 14 +- .../4/expected.json | 7 +- .../5/expected.json | 7 +- .../invalid-getter-param-count/actual.js | 3 + .../invalid-getter-param-count/options.json | 3 + .../invalid-setter-param-count/actual.js | 3 + .../invalid-setter-param-count/options.json | 3 + test/fixtures/flow/type-alias/4/expected.json | 56 +- .../flow/type-annotations/108/expected.json | 84 ++- .../flow/type-annotations/110/expected.json | 7 +- .../flow/type-annotations/111/expected.json | 7 +- .../flow/type-annotations/136/expected.json | 7 +- .../flow/type-annotations/32/expected.json | 7 +- .../flow/type-annotations/33/expected.json | 7 +- .../flow/type-annotations/34/expected.json | 7 +- .../flow/type-annotations/35/expected.json | 7 +- .../flow/type-annotations/36/expected.json | 14 +- .../flow/type-annotations/37/expected.json | 14 +- .../flow/type-annotations/38/expected.json | 14 +- .../flow/type-annotations/39/expected.json | 14 +- .../flow/type-annotations/40/expected.json | 14 +- .../flow/type-annotations/42/expected.json | 37 +- .../flow/type-annotations/43/expected.json | 37 +- .../flow/type-annotations/60/expected.json | 7 +- .../flow/type-annotations/61/expected.json | 7 +- .../flow/type-annotations/63/expected.json | 7 +- .../flow/type-annotations/98/expected.json | 21 +- .../flow/type-exports/interface/expected.json | 14 +- .../expected.json | 296 ++++---- .../expected.json | 148 ++-- .../interface-reserved-word/expected.json | 148 ++-- .../type-object-reserved-word/expected.json | 148 ++-- test/fixtures/flow/typecasts/2/expected.json | 14 +- 117 files changed, 4857 insertions(+), 708 deletions(-) create mode 100644 test/fixtures/flow/class-properties/getter-setter/actual.js create mode 100644 test/fixtures/flow/class-properties/getter-setter/expected.json create mode 100644 test/fixtures/flow/class-properties/invalid-getter-setter/actual.js create mode 100644 test/fixtures/flow/class-properties/invalid-getter-setter/options.json create mode 100644 test/fixtures/flow/class-properties/invalid-named-static/expected.json create mode 100644 test/fixtures/flow/declare-export/export-class/actual.js create mode 100644 test/fixtures/flow/declare-export/export-class/expected.json create mode 100644 test/fixtures/flow/declare-export/export-default-arrow/actual.js create mode 100644 test/fixtures/flow/declare-export/export-default-arrow/expected.json create mode 100644 test/fixtures/flow/declare-export/export-default-class/actual.js create mode 100644 test/fixtures/flow/declare-export/export-default-class/expected.json create mode 100644 test/fixtures/flow/declare-export/export-default-function/actual.js create mode 100644 test/fixtures/flow/declare-export/export-default-function/expected.json create mode 100644 test/fixtures/flow/declare-export/export-default-union/actual.js create mode 100644 test/fixtures/flow/declare-export/export-default-union/expected.json create mode 100644 test/fixtures/flow/declare-export/export-from/actual.js create mode 100644 test/fixtures/flow/declare-export/export-from/expected.json create mode 100644 test/fixtures/flow/declare-export/export-function/actual.js create mode 100644 test/fixtures/flow/declare-export/export-function/expected.json create mode 100644 test/fixtures/flow/declare-export/export-interface-and-var/actual.js create mode 100644 test/fixtures/flow/declare-export/export-interface-and-var/expected.json create mode 100644 test/fixtures/flow/declare-export/export-interface-commonjs/actual.js create mode 100644 test/fixtures/flow/declare-export/export-interface-commonjs/expected.json create mode 100644 test/fixtures/flow/declare-export/export-interface/actual.js create mode 100644 test/fixtures/flow/declare-export/export-interface/expected.json create mode 100644 test/fixtures/flow/declare-export/export-named-pattern/actual.js create mode 100644 test/fixtures/flow/declare-export/export-named-pattern/expected.json create mode 100644 test/fixtures/flow/declare-export/export-star-as/actual.js create mode 100644 test/fixtures/flow/declare-export/export-star-as/expected.json create mode 100644 test/fixtures/flow/declare-export/export-star-as/options.json create mode 100644 test/fixtures/flow/declare-export/export-star/actual.js create mode 100644 test/fixtures/flow/declare-export/export-star/expected.json create mode 100644 test/fixtures/flow/declare-export/export-type-and-var/actual.js create mode 100644 test/fixtures/flow/declare-export/export-type-and-var/expected.json create mode 100644 test/fixtures/flow/declare-export/export-type-commonjs/actual.js create mode 100644 test/fixtures/flow/declare-export/export-type-commonjs/expected.json create mode 100644 test/fixtures/flow/declare-export/export-type/actual.js create mode 100644 test/fixtures/flow/declare-export/export-type/expected.json create mode 100644 test/fixtures/flow/declare-export/export-var/actual.js create mode 100644 test/fixtures/flow/declare-export/export-var/expected.json create mode 100644 test/fixtures/flow/declare-export/invalid-declare-export-type/actual.js create mode 100644 test/fixtures/flow/declare-export/invalid-declare-export-type/options.json create mode 100644 test/fixtures/flow/declare-export/invalid-export-arrow/actual.js create mode 100644 test/fixtures/flow/declare-export/invalid-export-arrow/options.json create mode 100644 test/fixtures/flow/declare-export/invalid-export-const/actual.js create mode 100644 test/fixtures/flow/declare-export/invalid-export-const/options.json create mode 100644 test/fixtures/flow/declare-export/invalid-export-default-function/actual.js create mode 100644 test/fixtures/flow/declare-export/invalid-export-default-function/options.json create mode 100644 test/fixtures/flow/declare-export/invalid-export-default-var/actual.js create mode 100644 test/fixtures/flow/declare-export/invalid-export-default-var/options.json create mode 100644 test/fixtures/flow/declare-export/invalid-export-interface/actual.js create mode 100644 test/fixtures/flow/declare-export/invalid-export-interface/options.json create mode 100644 test/fixtures/flow/declare-export/invalid-export-let/actual.js create mode 100644 test/fixtures/flow/declare-export/invalid-export-let/options.json create mode 100644 test/fixtures/flow/declare-module/10/actual.js create mode 100644 test/fixtures/flow/declare-module/10/expected.json create mode 100644 test/fixtures/flow/declare-module/invalid-commonjs-module/actual.js create mode 100644 test/fixtures/flow/declare-module/invalid-commonjs-module/options.json create mode 100644 test/fixtures/flow/declare-module/invalid-es-module/actual.js create mode 100644 test/fixtures/flow/declare-module/invalid-es-module/options.json create mode 100644 test/fixtures/flow/declare-module/invalid-module-in-module/actual.js create mode 100644 test/fixtures/flow/declare-module/invalid-module-in-module/options.json create mode 100644 test/fixtures/flow/declare-module/invalid-multiple-commonjs/actual.js create mode 100644 test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json create mode 100644 test/fixtures/flow/declare-statements/invalid-literal/actual.js create mode 100644 test/fixtures/flow/declare-statements/invalid-literal/options.json create mode 100644 test/fixtures/flow/object-types/invalid-getter-param-count/actual.js create mode 100644 test/fixtures/flow/object-types/invalid-getter-param-count/options.json create mode 100644 test/fixtures/flow/object-types/invalid-setter-param-count/actual.js create mode 100644 test/fixtures/flow/object-types/invalid-setter-param-count/options.json diff --git a/.gitignore b/.gitignore index 90283a241b..4dfb35cc7a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build coverage lib node_modules +npm-debug.log diff --git a/src/parser/statement.js b/src/parser/statement.js index 08885a009c..f4bd38fb2f 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -810,7 +810,8 @@ pp.parseClassSuper = function (node) { // Parses module export declaration. pp.parseExport = function (node) { - this.next(); + this.eat(tt._export); + // export * from '...' if (this.match(tt.star)) { const specifier = this.startNode(); diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 2eed420119..3d55c4e7a3 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -105,7 +105,7 @@ pp.flowParseDeclareFunction = function (node) { return this.finishNode(node, "DeclareFunction"); }; -pp.flowParseDeclare = function (node) { +pp.flowParseDeclare = function (node, insideModule) { if (this.match(tt._class)) { return this.flowParseDeclareClass(node); } else if (this.match(tt._function)) { @@ -116,12 +116,15 @@ pp.flowParseDeclare = function (node) { if (this.lookahead().type === tt.dot) { return this.flowParseDeclareModuleExports(node); } else { + if (insideModule) this.unexpected(null, "`declare module` cannot be used inside another `declare module`"); return this.flowParseDeclareModule(node); } } else if (this.isContextual("type")) { return this.flowParseDeclareTypeAlias(node); } else if (this.isContextual("interface")) { return this.flowParseDeclareInterface(node); + } else if (this.match(tt._export)) { + return this.flowParseDeclareExportDeclaration(node, insideModule); } else { this.unexpected(); } @@ -134,6 +137,17 @@ pp.flowParseDeclareVariable = function (node) { return this.finishNode(node, "DeclareVariable"); }; +function isEsModuleType(bodyElement) { + return bodyElement.type === "DeclareExportAllDeclaration" || + ( + bodyElement.type === "DeclareExportDeclaration" && + ( + !bodyElement.declaration || + (bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration") + ) + ); +} + pp.flowParseDeclareModule = function (node) { this.next(); @@ -167,9 +181,94 @@ pp.flowParseDeclareModule = function (node) { this.expect(tt.braceR); this.finishNode(bodyNode, "BlockStatement"); + + let kind = null; + let hasModuleExport = false; + const errorMessage = "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module"; + body.forEach((bodyElement) => { + if (isEsModuleType(bodyElement)) { + if (kind === "CommonJS") this.unexpected(bodyElement.start, errorMessage); + kind = "ES"; + } else if (bodyElement.type === "DeclareModuleExports") { + if (hasModuleExport) this.unexpected(bodyElement.start, "Duplicate `declare module.exports` statement"); + if (kind === "ES") this.unexpected(bodyElement.start, errorMessage); + kind = "CommonJS"; + hasModuleExport = true; + } + }); + + node.kind = kind || "CommonJS"; return this.finishNode(node, "DeclareModule"); }; +const exportSuggestions = { + const: "declare export var", + let: "declare export var", + type: "export type", + interface: "export interface", +}; + +pp.flowParseDeclareExportDeclaration = function (node, insideModule) { + this.expect(tt._export); + + if (this.eat(tt._default)) { + if (this.match(tt._function) || this.match(tt._class)) { + // declare export default class ... + // declare export default function ... + node.declaration = this.flowParseDeclare(this.startNode()); + } else { + // declare export default [type]; + node.declaration = this.flowParseType(); + this.semicolon(); + } + node.default = true; + + return this.finishNode(node, "DeclareExportDeclaration"); + } else { + if ( + this.match(tt._const) || this.match(tt._let) || + ( + (this.isContextual("type") || this.isContextual("interface")) && + !insideModule + ) + ) { + const label = this.state.value; + const suggestion = exportSuggestions[label]; + this.unexpected(this.state.start, `\`declare export ${label}\` is not supported. Use \`${suggestion}\` instead`); + } + + if ( + this.match(tt._var) || // declare export var ... + this.match(tt._function) || // declare export function ... + this.match(tt._class) // declare export class ... + ) { + node.declaration = this.flowParseDeclare(this.startNode()); + node.default = false; + + return this.finishNode(node, "DeclareExportDeclaration"); + } else if ( + this.match(tt.star) || // declare export * from '' + this.match(tt.braceL) || // declare export {} ... + this.isContextual("interface") || // declare export interface ... + this.isContextual("type") // declare export type ... + ) { + node = this.parseExport(node); + if (node.type === "ExportNamedDeclaration") { + // flow does not support the ExportNamedDeclaration + node.type = "ExportDeclaration"; + node.default = false; + delete node.exportKind; + } + + node.type = "Declare" + node.type; + + return node; + } + } + + this.unexpected(); +}; + pp.flowParseDeclareModuleExports = function (node) { this.expectContextual("module"); this.expect(tt.dot); @@ -381,15 +480,6 @@ pp.flowParseObjectTypeMethodish = function (node) { return this.finishNode(node, "FunctionTypeAnnotation"); }; -pp.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) { - const node = this.startNodeAt(startPos, startLoc); - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(startPos, startLoc)); - node.static = isStatic; - node.key = key; - node.optional = false; - return this.finishNode(node, "ObjectTypeProperty"); -}; - pp.flowParseObjectTypeCallProperty = function (node, isStatic) { const valueNode = this.startNode(); node.static = isStatic; @@ -402,9 +492,6 @@ pp.flowParseObjectType = function (allowStatic, allowExact, allowSpread) { this.state.inType = true; const nodeStart = this.startNode(); - let node; - let propertyKey; - let isStatic = false; nodeStart.callProperties = []; nodeStart.properties = []; @@ -425,10 +512,8 @@ pp.flowParseObjectType = function (allowStatic, allowExact, allowSpread) { nodeStart.exact = exact; while (!this.match(endDelim)) { - let optional = false; - const startPos = this.state.start; - const startLoc = this.state.startLoc; - node = this.startNode(); + let isStatic = false; + const node = this.startNode(); if (allowStatic && this.isContextual("static") && this.lookahead().type !== tt.colon) { this.next(); isStatic = true; @@ -444,44 +529,24 @@ pp.flowParseObjectType = function (allowStatic, allowExact, allowSpread) { } nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); } else { - if (this.match(tt.ellipsis)) { - if (!allowSpread) { - this.unexpected( - null, - "Spread operator cannot appear in class or interface definitions" - ); - } - if (variance) { - this.unexpected(variance.start, "Spread properties cannot have variance"); - } - this.expect(tt.ellipsis); - node.argument = this.flowParseType(); - nodeStart.properties.push(this.finishNode(node, "ObjectTypeSpreadProperty")); - } else { - propertyKey = this.flowParseObjectPropertyKey(); - if (this.isRelational("<") || this.match(tt.parenL)) { - // This is a method property - if (variance) { - this.unexpected(variance.start); - } - nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey)); - } else { - if (this.eat(tt.question)) { - optional = true; - } - node.key = propertyKey; - node.value = this.flowParseTypeInitialiser(); - node.optional = optional; - node.static = isStatic; - node.variance = variance; - nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty")); + let kind = "init"; + + if (this.isContextual("get") || this.isContextual("set")) { + const lookahead = this.lookahead(); + if ( + lookahead.type === tt.name || + lookahead.type === tt.string || + lookahead.type === tt.num + ) { + kind = this.state.value; + this.next(); } } + + nodeStart.properties.push(this.flowParseObjectTypeProperty(node, isStatic, variance, kind, allowSpread)); } this.flowObjectTypeSemicolon(); - - isStatic = false; } this.expect(endDelim); @@ -493,6 +558,65 @@ pp.flowParseObjectType = function (allowStatic, allowExact, allowSpread) { return out; }; +pp.flowParseObjectTypeProperty = function (node, isStatic, variance, kind, allowSpread) { + if (this.match(tt.ellipsis)) { + if (!allowSpread) { + this.unexpected( + null, + "Spread operator cannot appear in class or interface definitions" + ); + } + if (variance) { + this.unexpected(variance.start, "Spread properties cannot have variance"); + } + this.expect(tt.ellipsis); + node.argument = this.flowParseType(); + + return this.finishNode(node, "ObjectTypeSpreadProperty"); + } else { + node.key = this.flowParseObjectPropertyKey(); + node.static = isStatic; + node.kind = kind; + + let optional = false; + if (this.isRelational("<") || this.match(tt.parenL)) { + // This is a method property + if (variance) { + this.unexpected(variance.start); + } + + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); + if (kind === "get" || kind === "set") this.flowCheckGetterSetterParamCount(node); + } else { + if (kind !== "init") this.unexpected(); + if (this.eat(tt.question)) { + optional = true; + } + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + + } + + node.optional = optional; + + return this.finishNode(node, "ObjectTypeProperty"); + } +}; + +// This is similar to checkGetterSetterParamCount, but as +// babylon uses non estree properties we cannot reuse it here +pp.flowCheckGetterSetterParamCount = function (property) { + const paramCount = property.kind === "get" ? 0 : 1; + if (property.value.params.length !== paramCount) { + const start = property.start; + if (property.kind === "get") { + this.raise(start, "getter should have no params"); + } else { + this.raise(start, "setter should have exactly one param"); + } + } +}; + pp.flowObjectTypeSemicolon = function () { if (!this.eat(tt.semi) && !this.eat(tt.comma) && !this.match(tt.braceR) && !this.match(tt.braceBarR)) { @@ -898,7 +1022,7 @@ export default (superClass) => class extends superClass { parseExpressionStatement(node, expr) { if (expr.type === "Identifier") { if (expr.name === "declare") { - if (this.match(tt._class) || this.match(tt.name) || this.match(tt._function) || this.match(tt._var)) { + if (this.match(tt._class) || this.match(tt.name) || this.match(tt._function) || this.match(tt._var) || this.match(tt._export)) { return this.flowParseDeclare(node); } } else if (this.match(tt.name)) { diff --git a/test/fixtures/flow/call-properties/3/expected.json b/test/fixtures/flow/call-properties/3/expected.json index d5d5d6599e..acd2bf6782 100644 --- a/test/fixtures/flow/call-properties/3/expected.json +++ b/test/fixtures/flow/call-properties/3/expected.json @@ -282,6 +282,8 @@ }, "name": "y" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 25, @@ -297,9 +299,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/class-properties/getter-setter/actual.js b/test/fixtures/flow/class-properties/getter-setter/actual.js new file mode 100644 index 0000000000..7a6fc4985b --- /dev/null +++ b/test/fixtures/flow/class-properties/getter-setter/actual.js @@ -0,0 +1,8 @@ +declare class B { + get a(): number; + set b(a: number): void; + get "c"(): number; + set "d"(a: number): void; + get 1(): number; + set 2(a: number): void; +} diff --git a/test/fixtures/flow/class-properties/getter-setter/expected.json b/test/fixtures/flow/class-properties/getter-setter/expected.json new file mode 100644 index 0000000000..13744ddb93 --- /dev/null +++ b/test/fixtures/flow/class-properties/getter-setter/expected.json @@ -0,0 +1,656 @@ +{ + "type": "File", + "start": 0, + "end": 158, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 158, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 158, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "B" + }, + "name": "B" + }, + "typeParameters": null, + "extends": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 158, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 20, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "key": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionTypeAnnotation", + "start": 20, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 17 + } + } + } + }, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 39, + "end": 61, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "key": { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "b" + }, + "name": "b" + }, + "static": false, + "kind": "set", + "value": { + "type": "FunctionTypeAnnotation", + "start": 39, + "end": 61, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "params": [ + { + "type": "FunctionTypeParam", + "start": 45, + "end": 54, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "name": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 48, + "end": 54, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 17 + } + } + } + } + ], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 57, + "end": 61, + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 24 + } + } + } + }, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 65, + "end": 82, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "key": { + "type": "StringLiteral", + "start": 69, + "end": 72, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "extra": { + "rawValue": "c", + "raw": "\"c\"" + }, + "value": "c" + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionTypeAnnotation", + "start": 65, + "end": 82, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 76, + "end": 82, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 19 + } + } + } + }, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 86, + "end": 110, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "key": { + "type": "StringLiteral", + "start": 90, + "end": 93, + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 9 + } + }, + "extra": { + "rawValue": "d", + "raw": "\"d\"" + }, + "value": "d" + }, + "static": false, + "kind": "set", + "value": { + "type": "FunctionTypeAnnotation", + "start": 86, + "end": 110, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "params": [ + { + "type": "FunctionTypeParam", + "start": 94, + "end": 103, + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "name": { + "type": "Identifier", + "start": 94, + "end": 95, + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 97, + "end": 103, + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 19 + } + } + } + } + ], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 106, + "end": 110, + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 26 + } + } + } + }, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 114, + "end": 129, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "key": { + "type": "NumericLiteral", + "start": 118, + "end": 119, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "static": false, + "kind": "get", + "value": { + "type": "FunctionTypeAnnotation", + "start": 114, + "end": 129, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 123, + "end": 129, + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 17 + } + } + } + }, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 133, + "end": 155, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 24 + } + }, + "key": { + "type": "NumericLiteral", + "start": 137, + "end": 138, + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 7 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + }, + "static": false, + "kind": "set", + "value": { + "type": "FunctionTypeAnnotation", + "start": 133, + "end": 155, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 24 + } + }, + "params": [ + { + "type": "FunctionTypeParam", + "start": 139, + "end": 148, + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "name": { + "type": "Identifier", + "start": 139, + "end": 140, + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 142, + "end": 148, + "loc": { + "start": { + "line": 7, + "column": 11 + }, + "end": { + "line": 7, + "column": 17 + } + } + } + } + ], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 151, + "end": 155, + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 24 + } + } + } + }, + "optional": false + } + ], + "indexers": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/class-properties/invalid-getter-setter/actual.js b/test/fixtures/flow/class-properties/invalid-getter-setter/actual.js new file mode 100644 index 0000000000..0cc1b7fa51 --- /dev/null +++ b/test/fixtures/flow/class-properties/invalid-getter-setter/actual.js @@ -0,0 +1,3 @@ +declare class B { + get a: number; +} diff --git a/test/fixtures/flow/class-properties/invalid-getter-setter/options.json b/test/fixtures/flow/class-properties/invalid-getter-setter/options.json new file mode 100644 index 0000000000..4e84114247 --- /dev/null +++ b/test/fixtures/flow/class-properties/invalid-getter-setter/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (2:7)" +} diff --git a/test/fixtures/flow/class-properties/invalid-named-static/expected.json b/test/fixtures/flow/class-properties/invalid-named-static/expected.json new file mode 100644 index 0000000000..016fc254c0 --- /dev/null +++ b/test/fixtures/flow/class-properties/invalid-named-static/expected.json @@ -0,0 +1,33 @@ +{ + "type": "File", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 0, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 0 + } + }, + "sourceType": "module", + "body": [], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/class-properties/named-static/expected.json b/test/fixtures/flow/class-properties/named-static/expected.json index 61bf3d6674..eea8e7d6a6 100644 --- a/test/fixtures/flow/class-properties/named-static/expected.json +++ b/test/fixtures/flow/class-properties/named-static/expected.json @@ -109,6 +109,8 @@ }, "name": "static" }, + "static": false, + "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 28, @@ -142,9 +144,8 @@ "name": "T" } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/declare-export/export-class/actual.js b/test/fixtures/flow/declare-export/export-class/actual.js new file mode 100644 index 0000000000..07165a036a --- /dev/null +++ b/test/fixtures/flow/declare-export/export-class/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export class Foo { meth(p1: number): void; } } diff --git a/test/fixtures/flow/declare-export/export-class/expected.json b/test/fixtures/flow/declare-export/export-class/expected.json new file mode 100644 index 0000000000..d403da0296 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-class/expected.json @@ -0,0 +1,275 @@ +{ + "type": "File", + "start": 0, + "end": 77, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 77 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 77, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 77 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 77, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 77 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 77, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 77 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 75, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 75 + } + }, + "declaration": { + "type": "DeclareClass", + "start": 38, + "end": 75, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 75 + } + }, + "id": { + "type": "Identifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "typeParameters": null, + "extends": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 48, + "end": 75, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 75 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 50, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 72 + } + }, + "key": { + "type": "Identifier", + "start": 50, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 54 + }, + "identifierName": "meth" + }, + "name": "meth" + }, + "static": false, + "kind": "init", + "value": { + "type": "FunctionTypeAnnotation", + "start": 50, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 72 + } + }, + "params": [ + { + "type": "FunctionTypeParam", + "start": 55, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 65 + } + }, + "name": { + "type": "Identifier", + "start": 55, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 57 + }, + "identifierName": "p1" + }, + "name": "p1" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 59, + "end": 65, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 65 + } + } + } + } + ], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 68, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 68 + }, + "end": { + "line": 1, + "column": 72 + } + } + } + }, + "optional": false + } + ], + "indexers": [], + "exact": false + } + }, + "default": false + } + ] + }, + "kind": "ES" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-default-arrow/actual.js b/test/fixtures/flow/declare-export/export-default-arrow/actual.js new file mode 100644 index 0000000000..f6ae0263aa --- /dev/null +++ b/test/fixtures/flow/declare-export/export-default-arrow/actual.js @@ -0,0 +1 @@ +declare export default (a:number) => number diff --git a/test/fixtures/flow/declare-export/export-default-arrow/expected.json b/test/fixtures/flow/declare-export/export-default-arrow/expected.json new file mode 100644 index 0000000000..cd5ff0a411 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-default-arrow/expected.json @@ -0,0 +1,132 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "declaration": { + "type": "FunctionTypeAnnotation", + "start": 23, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "params": [ + { + "type": "FunctionTypeParam", + "start": 24, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "name": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "a" + }, + "name": "a" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 32 + } + } + } + } + ], + "rest": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + } + }, + "typeParameters": null + }, + "default": true + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-default-class/actual.js b/test/fixtures/flow/declare-export/export-default-class/actual.js new file mode 100644 index 0000000000..c26ec8d304 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-default-class/actual.js @@ -0,0 +1 @@ +declare export default class A {}; diff --git a/test/fixtures/flow/declare-export/export-default-class/expected.json b/test/fixtures/flow/declare-export/export-default-class/expected.json new file mode 100644 index 0000000000..62d258e3a7 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-default-class/expected.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "declaration": { + "type": "DeclareClass", + "start": 23, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "exact": false + } + }, + "default": true + }, + { + "type": "EmptyStatement", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-default-function/actual.js b/test/fixtures/flow/declare-export/export-default-function/actual.js new file mode 100644 index 0000000000..7f28065f5c --- /dev/null +++ b/test/fixtures/flow/declare-export/export-default-function/actual.js @@ -0,0 +1 @@ +declare export default function bar(p1: number): string; diff --git a/test/fixtures/flow/declare-export/export-default-function/expected.json b/test/fixtures/flow/declare-export/export-default-function/expected.json new file mode 100644 index 0000000000..b433681f6b --- /dev/null +++ b/test/fixtures/flow/declare-export/export-default-function/expected.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "declaration": { + "type": "DeclareFunction", + "start": 23, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 55 + }, + "identifierName": "bar" + }, + "name": "bar", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 35, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 35, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "typeParameters": null, + "params": [ + { + "type": "FunctionTypeParam", + "start": 36, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "name": { + "type": "Identifier", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "p1" + }, + "name": "p1" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 40, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 46 + } + } + } + } + ], + "rest": null, + "returnType": { + "type": "StringTypeAnnotation", + "start": 49, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 55 + } + } + } + } + } + }, + "predicate": null + }, + "default": true + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-default-union/actual.js b/test/fixtures/flow/declare-export/export-default-union/actual.js new file mode 100644 index 0000000000..ec6a2fb669 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-default-union/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export default number|string; } \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-default-union/expected.json b/test/fixtures/flow/declare-export/export-default-union/expected.json new file mode 100644 index 0000000000..331f6890a2 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-default-union/expected.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "declaration": { + "type": "UnionTypeAnnotation", + "start": 46, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "types": [ + { + "type": "NumberTypeAnnotation", + "start": 46, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 52 + } + } + }, + { + "type": "StringTypeAnnotation", + "start": 53, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 59 + } + } + } + ] + }, + "default": true + } + ] + }, + "kind": "ES" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-from/actual.js b/test/fixtures/flow/declare-export/export-from/actual.js new file mode 100644 index 0000000000..516e8e2100 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-from/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export {a,} from "bar"; } diff --git a/test/fixtures/flow/declare-export/export-from/expected.json b/test/fixtures/flow/declare-export/export-from/expected.json new file mode 100644 index 0000000000..6fde07ca48 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-from/expected.json @@ -0,0 +1,175 @@ +{ + "type": "File", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "local": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "a" + }, + "name": "a" + }, + "exported": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ], + "source": { + "type": "StringLiteral", + "start": 48, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "extra": { + "rawValue": "bar", + "raw": "\"bar\"" + }, + "value": "bar" + }, + "default": false + } + ] + }, + "kind": "ES" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-function/actual.js b/test/fixtures/flow/declare-export/export-function/actual.js new file mode 100644 index 0000000000..4b0b254fe4 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-function/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export function bar(p1: number): string; } diff --git a/test/fixtures/flow/declare-export/export-function/expected.json b/test/fixtures/flow/declare-export/export-function/expected.json new file mode 100644 index 0000000000..79377de65a --- /dev/null +++ b/test/fixtures/flow/declare-export/export-function/expected.json @@ -0,0 +1,233 @@ +{ + "type": "File", + "start": 0, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 73 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 73 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 73 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 73 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 71, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 71 + } + }, + "declaration": { + "type": "DeclareFunction", + "start": 38, + "end": 71, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 71 + } + }, + "id": { + "type": "Identifier", + "start": 47, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 70 + }, + "identifierName": "bar" + }, + "name": "bar", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 50, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 50, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 70 + } + }, + "typeParameters": null, + "params": [ + { + "type": "FunctionTypeParam", + "start": 51, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "name": { + "type": "Identifier", + "start": 51, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 53 + }, + "identifierName": "p1" + }, + "name": "p1" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 55, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 61 + } + } + } + } + ], + "rest": null, + "returnType": { + "type": "StringTypeAnnotation", + "start": 64, + "end": 70, + "loc": { + "start": { + "line": 1, + "column": 64 + }, + "end": { + "line": 1, + "column": 70 + } + } + } + } + } + }, + "predicate": null + }, + "default": false + } + ] + }, + "kind": "ES" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-interface-and-var/actual.js b/test/fixtures/flow/declare-export/export-interface-and-var/actual.js new file mode 100644 index 0000000000..2f9a87e3ad --- /dev/null +++ b/test/fixtures/flow/declare-export/export-interface-and-var/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export interface bar {} declare export var baz: number; } diff --git a/test/fixtures/flow/declare-export/export-interface-and-var/expected.json b/test/fixtures/flow/declare-export/export-interface-and-var/expected.json new file mode 100644 index 0000000000..c793dc2bb5 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-interface-and-var/expected.json @@ -0,0 +1,237 @@ +{ + "type": "File", + "start": 0, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "InterfaceDeclaration", + "start": 38, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "id": { + "type": "Identifier", + "start": 48, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "typeParameters": null, + "extends": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 52, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "exact": false + } + }, + "default": false + }, + { + "type": "DeclareExportDeclaration", + "start": 55, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 86 + } + }, + "declaration": { + "type": "DeclareVariable", + "start": 70, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 70 + }, + "end": { + "line": 1, + "column": 86 + } + }, + "id": { + "type": "Identifier", + "start": 74, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 74 + }, + "end": { + "line": 1, + "column": 85 + }, + "identifierName": "baz" + }, + "name": "baz", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 77, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 77 + }, + "end": { + "line": 1, + "column": 85 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 79, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 79 + }, + "end": { + "line": 1, + "column": 85 + } + } + } + } + } + }, + "default": false + } + ] + }, + "kind": "ES" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-interface-commonjs/actual.js b/test/fixtures/flow/declare-export/export-interface-commonjs/actual.js new file mode 100644 index 0000000000..d624036826 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-interface-commonjs/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export interface bar {} declare module.exports: number; } diff --git a/test/fixtures/flow/declare-export/export-interface-commonjs/expected.json b/test/fixtures/flow/declare-export/export-interface-commonjs/expected.json new file mode 100644 index 0000000000..9263cc2989 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-interface-commonjs/expected.json @@ -0,0 +1,204 @@ +{ + "type": "File", + "start": 0, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "InterfaceDeclaration", + "start": 38, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "id": { + "type": "Identifier", + "start": 48, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "typeParameters": null, + "extends": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 52, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "exact": false + } + }, + "default": false + }, + { + "type": "DeclareModuleExports", + "start": 55, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 86 + } + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 77, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 77 + }, + "end": { + "line": 1, + "column": 85 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 79, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 79 + }, + "end": { + "line": 1, + "column": 85 + } + } + } + } + } + ] + }, + "kind": "CommonJS" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-interface/actual.js b/test/fixtures/flow/declare-export/export-interface/actual.js new file mode 100644 index 0000000000..29047342e2 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-interface/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export interface bar {} } diff --git a/test/fixtures/flow/declare-export/export-interface/expected.json b/test/fixtures/flow/declare-export/export-interface/expected.json new file mode 100644 index 0000000000..2524845b73 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-interface/expected.json @@ -0,0 +1,159 @@ +{ + "type": "File", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "InterfaceDeclaration", + "start": 38, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "id": { + "type": "Identifier", + "start": 48, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "typeParameters": null, + "extends": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 52, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "exact": false + } + }, + "default": false + } + ] + }, + "kind": "CommonJS" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-named-pattern/actual.js b/test/fixtures/flow/declare-export/export-named-pattern/actual.js new file mode 100644 index 0000000000..6a25a18365 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-named-pattern/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export {a,}; } diff --git a/test/fixtures/flow/declare-export/export-named-pattern/expected.json b/test/fixtures/flow/declare-export/export-named-pattern/expected.json new file mode 100644 index 0000000000..6e1791ff95 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-named-pattern/expected.json @@ -0,0 +1,156 @@ +{ + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "declaration": null, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "local": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "a" + }, + "name": "a" + }, + "exported": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ], + "source": null, + "default": false + } + ] + }, + "kind": "ES" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-star-as/actual.js b/test/fixtures/flow/declare-export/export-star-as/actual.js new file mode 100644 index 0000000000..3f0c9ebabf --- /dev/null +++ b/test/fixtures/flow/declare-export/export-star-as/actual.js @@ -0,0 +1 @@ +declare export * as test from '' diff --git a/test/fixtures/flow/declare-export/export-star-as/expected.json b/test/fixtures/flow/declare-export/export-star-as/expected.json new file mode 100644 index 0000000000..ecf6deda99 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-star-as/expected.json @@ -0,0 +1,104 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "specifiers": [ + { + "type": "ExportNamespaceSpecifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "exported": { + "type": "Identifier", + "start": 20, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "test" + }, + "name": "test" + } + } + ], + "source": { + "type": "StringLiteral", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "extra": { + "rawValue": "", + "raw": "''" + }, + "value": "" + }, + "default": false + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-star-as/options.json b/test/fixtures/flow/declare-export/export-star-as/options.json new file mode 100644 index 0000000000..edcc382322 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-star-as/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["exportExtensions"] +} diff --git a/test/fixtures/flow/declare-export/export-star/actual.js b/test/fixtures/flow/declare-export/export-star/actual.js new file mode 100644 index 0000000000..25be792a09 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-star/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export * from "bar"; } diff --git a/test/fixtures/flow/declare-export/export-star/expected.json b/test/fixtures/flow/declare-export/export-star/expected.json new file mode 100644 index 0000000000..16df6ff122 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-star/expected.json @@ -0,0 +1,122 @@ +{ + "type": "File", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "body": [ + { + "type": "DeclareExportAllDeclaration", + "start": 23, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "source": { + "type": "StringLiteral", + "start": 45, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "extra": { + "rawValue": "bar", + "raw": "\"bar\"" + }, + "value": "bar" + } + } + ] + }, + "kind": "ES" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-type-and-var/actual.js b/test/fixtures/flow/declare-export/export-type-and-var/actual.js new file mode 100644 index 0000000000..f4de1e146f --- /dev/null +++ b/test/fixtures/flow/declare-export/export-type-and-var/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export type bar = number; declare export var baz: number; } diff --git a/test/fixtures/flow/declare-export/export-type-and-var/expected.json b/test/fixtures/flow/declare-export/export-type-and-var/expected.json new file mode 100644 index 0000000000..1b6544a294 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-type-and-var/expected.json @@ -0,0 +1,231 @@ +{ + "type": "File", + "start": 0, + "end": 90, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 90 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 90, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 90 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 90, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 90 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 90, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 90 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "TypeAlias", + "start": 38, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "typeParameters": null, + "right": { + "type": "NumberTypeAnnotation", + "start": 49, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 55 + } + } + } + }, + "default": false + }, + { + "type": "DeclareExportDeclaration", + "start": 57, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "declaration": { + "type": "DeclareVariable", + "start": 72, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 72 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "id": { + "type": "Identifier", + "start": 76, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 76 + }, + "end": { + "line": 1, + "column": 87 + }, + "identifierName": "baz" + }, + "name": "baz", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 79, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 79 + }, + "end": { + "line": 1, + "column": 87 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 81, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 81 + }, + "end": { + "line": 1, + "column": 87 + } + } + } + } + } + }, + "default": false + } + ] + }, + "kind": "ES" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-type-commonjs/actual.js b/test/fixtures/flow/declare-export/export-type-commonjs/actual.js new file mode 100644 index 0000000000..21cd35d78d --- /dev/null +++ b/test/fixtures/flow/declare-export/export-type-commonjs/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export type bar = number; declare module.exports: number; } diff --git a/test/fixtures/flow/declare-export/export-type-commonjs/expected.json b/test/fixtures/flow/declare-export/export-type-commonjs/expected.json new file mode 100644 index 0000000000..c97883f7d0 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-type-commonjs/expected.json @@ -0,0 +1,198 @@ +{ + "type": "File", + "start": 0, + "end": 90, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 90 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 90, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 90 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 90, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 90 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 90, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 90 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "TypeAlias", + "start": 38, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "typeParameters": null, + "right": { + "type": "NumberTypeAnnotation", + "start": 49, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 55 + } + } + } + }, + "default": false + }, + { + "type": "DeclareModuleExports", + "start": 57, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 79, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 79 + }, + "end": { + "line": 1, + "column": 87 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 81, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 81 + }, + "end": { + "line": 1, + "column": 87 + } + } + } + } + } + ] + }, + "kind": "CommonJS" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-type/actual.js b/test/fixtures/flow/declare-export/export-type/actual.js new file mode 100644 index 0000000000..422ea5547e --- /dev/null +++ b/test/fixtures/flow/declare-export/export-type/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export type bar = number; } diff --git a/test/fixtures/flow/declare-export/export-type/expected.json b/test/fixtures/flow/declare-export/export-type/expected.json new file mode 100644 index 0000000000..aa03bfa368 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-type/expected.json @@ -0,0 +1,153 @@ +{ + "type": "File", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "TypeAlias", + "start": 38, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "typeParameters": null, + "right": { + "type": "NumberTypeAnnotation", + "start": 49, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 55 + } + } + } + }, + "default": false + } + ] + }, + "kind": "CommonJS" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/export-var/actual.js b/test/fixtures/flow/declare-export/export-var/actual.js new file mode 100644 index 0000000000..b14a9dda53 --- /dev/null +++ b/test/fixtures/flow/declare-export/export-var/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export var a: number; } diff --git a/test/fixtures/flow/declare-export/export-var/expected.json b/test/fixtures/flow/declare-export/export-var/expected.json new file mode 100644 index 0000000000..d176ea111b --- /dev/null +++ b/test/fixtures/flow/declare-export/export-var/expected.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "declaration": { + "type": "DeclareVariable", + "start": 38, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "a" + }, + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 43, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 45, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 51 + } + } + } + } + } + }, + "default": false + } + ] + }, + "kind": "ES" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-export/invalid-declare-export-type/actual.js b/test/fixtures/flow/declare-export/invalid-declare-export-type/actual.js new file mode 100644 index 0000000000..f2c105f061 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-declare-export-type/actual.js @@ -0,0 +1 @@ +declare export type foo = number; diff --git a/test/fixtures/flow/declare-export/invalid-declare-export-type/options.json b/test/fixtures/flow/declare-export/invalid-declare-export-type/options.json new file mode 100644 index 0000000000..2f2a34e735 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-declare-export-type/options.json @@ -0,0 +1,3 @@ +{ + "throws": "`declare export type` is not supported. Use `export type` instead (1:15)" +} diff --git a/test/fixtures/flow/declare-export/invalid-export-arrow/actual.js b/test/fixtures/flow/declare-export/invalid-export-arrow/actual.js new file mode 100644 index 0000000000..a5b27cf870 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-arrow/actual.js @@ -0,0 +1 @@ +declare export (a:number) => number diff --git a/test/fixtures/flow/declare-export/invalid-export-arrow/options.json b/test/fixtures/flow/declare-export/invalid-export-arrow/options.json new file mode 100644 index 0000000000..98d7123790 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-arrow/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:15)" +} diff --git a/test/fixtures/flow/declare-export/invalid-export-const/actual.js b/test/fixtures/flow/declare-export/invalid-export-const/actual.js new file mode 100644 index 0000000000..8ee799daa5 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-const/actual.js @@ -0,0 +1 @@ +declare export const foo: number diff --git a/test/fixtures/flow/declare-export/invalid-export-const/options.json b/test/fixtures/flow/declare-export/invalid-export-const/options.json new file mode 100644 index 0000000000..8466e2ca85 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-const/options.json @@ -0,0 +1,3 @@ +{ + "throws": "`declare export const` is not supported. Use `declare export var` instead (1:15)" +} diff --git a/test/fixtures/flow/declare-export/invalid-export-default-function/actual.js b/test/fixtures/flow/declare-export/invalid-export-default-function/actual.js new file mode 100644 index 0000000000..237a1224ad --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-default-function/actual.js @@ -0,0 +1 @@ +declare export default function (p1: number): string; diff --git a/test/fixtures/flow/declare-export/invalid-export-default-function/options.json b/test/fixtures/flow/declare-export/invalid-export-default-function/options.json new file mode 100644 index 0000000000..40981abf7e --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-default-function/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:32)" +} diff --git a/test/fixtures/flow/declare-export/invalid-export-default-var/actual.js b/test/fixtures/flow/declare-export/invalid-export-default-var/actual.js new file mode 100644 index 0000000000..c90458445b --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-default-var/actual.js @@ -0,0 +1 @@ +declare export default var a: number diff --git a/test/fixtures/flow/declare-export/invalid-export-default-var/options.json b/test/fixtures/flow/declare-export/invalid-export-default-var/options.json new file mode 100644 index 0000000000..562afcef48 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-default-var/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:23)" +} diff --git a/test/fixtures/flow/declare-export/invalid-export-interface/actual.js b/test/fixtures/flow/declare-export/invalid-export-interface/actual.js new file mode 100644 index 0000000000..aad1860f10 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-interface/actual.js @@ -0,0 +1 @@ +declare export interface bar {} diff --git a/test/fixtures/flow/declare-export/invalid-export-interface/options.json b/test/fixtures/flow/declare-export/invalid-export-interface/options.json new file mode 100644 index 0000000000..3977f3c480 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-interface/options.json @@ -0,0 +1,3 @@ +{ + "throws": "`declare export interface` is not supported. Use `export interface` instead (1:15)" +} diff --git a/test/fixtures/flow/declare-export/invalid-export-let/actual.js b/test/fixtures/flow/declare-export/invalid-export-let/actual.js new file mode 100644 index 0000000000..cffa3c63b6 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-let/actual.js @@ -0,0 +1 @@ +declare export let foo: number diff --git a/test/fixtures/flow/declare-export/invalid-export-let/options.json b/test/fixtures/flow/declare-export/invalid-export-let/options.json new file mode 100644 index 0000000000..745a711f11 --- /dev/null +++ b/test/fixtures/flow/declare-export/invalid-export-let/options.json @@ -0,0 +1,3 @@ +{ + "throws": "`declare export let` is not supported. Use `declare export var` instead (1:15)" +} diff --git a/test/fixtures/flow/declare-module/1/expected.json b/test/fixtures/flow/declare-module/1/expected.json index 543af8e16b..f209133694 100644 --- a/test/fixtures/flow/declare-module/1/expected.json +++ b/test/fixtures/flow/declare-module/1/expected.json @@ -74,7 +74,8 @@ } }, "body": [] - } + }, + "kind": "CommonJS" } ], "directives": [] diff --git a/test/fixtures/flow/declare-module/10/actual.js b/test/fixtures/flow/declare-module/10/actual.js new file mode 100644 index 0000000000..ccbf397e99 --- /dev/null +++ b/test/fixtures/flow/declare-module/10/actual.js @@ -0,0 +1 @@ +declare module.exports: { foo(): number; } diff --git a/test/fixtures/flow/declare-module/10/expected.json b/test/fixtures/flow/declare-module/10/expected.json new file mode 100644 index 0000000000..5b28d3a95c --- /dev/null +++ b/test/fixtures/flow/declare-module/10/expected.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "sourceType": "module", + "body": [ + { + "type": "DeclareModuleExports", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 22, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "typeAnnotation": { + "type": "ObjectTypeAnnotation", + "start": 24, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 26, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "key": { + "type": "Identifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "kind": "init", + "value": { + "type": "FunctionTypeAnnotation", + "start": 26, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + } + } + }, + "optional": false + } + ], + "indexers": [], + "exact": false + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/declare-module/2/expected.json b/test/fixtures/flow/declare-module/2/expected.json index 887e105b6e..8643e9feaa 100644 --- a/test/fixtures/flow/declare-module/2/expected.json +++ b/test/fixtures/flow/declare-module/2/expected.json @@ -77,7 +77,8 @@ } }, "body": [] - } + }, + "kind": "CommonJS" } ], "directives": [] diff --git a/test/fixtures/flow/declare-module/3/expected.json b/test/fixtures/flow/declare-module/3/expected.json index b390a8eba8..8e61c95762 100644 --- a/test/fixtures/flow/declare-module/3/expected.json +++ b/test/fixtures/flow/declare-module/3/expected.json @@ -137,7 +137,8 @@ } } ] - } + }, + "kind": "CommonJS" } ], "directives": [] diff --git a/test/fixtures/flow/declare-module/4/expected.json b/test/fixtures/flow/declare-module/4/expected.json index a22533aca2..71deaaf280 100644 --- a/test/fixtures/flow/declare-module/4/expected.json +++ b/test/fixtures/flow/declare-module/4/expected.json @@ -156,7 +156,8 @@ "predicate": null } ] - } + }, + "kind": "CommonJS" } ], "directives": [] diff --git a/test/fixtures/flow/declare-module/5/expected.json b/test/fixtures/flow/declare-module/5/expected.json index 27fad53409..d6491c6f37 100644 --- a/test/fixtures/flow/declare-module/5/expected.json +++ b/test/fixtures/flow/declare-module/5/expected.json @@ -138,6 +138,25 @@ "column": 50 } }, + "key": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 37, @@ -171,24 +190,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "foo" - }, - "name": "foo" - }, "optional": false } ], @@ -197,7 +198,8 @@ } } ] - } + }, + "kind": "CommonJS" } ], "directives": [] diff --git a/test/fixtures/flow/declare-module/6/expected.json b/test/fixtures/flow/declare-module/6/expected.json index 8024e7d3d1..7b1772c283 100644 --- a/test/fixtures/flow/declare-module/6/expected.json +++ b/test/fixtures/flow/declare-module/6/expected.json @@ -132,6 +132,25 @@ "column": 58 } }, + "key": { + "type": "Identifier", + "start": 45, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 48 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 45, @@ -165,24 +184,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 45, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "foo" - }, - "name": "foo" - }, "optional": false } ], @@ -192,7 +193,8 @@ } } ] - } + }, + "kind": "CommonJS" } ], "directives": [] diff --git a/test/fixtures/flow/declare-module/9/expected.json b/test/fixtures/flow/declare-module/9/expected.json index d549499d21..37a6fe2711 100644 --- a/test/fixtures/flow/declare-module/9/expected.json +++ b/test/fixtures/flow/declare-module/9/expected.json @@ -120,7 +120,8 @@ } } ] - } + }, + "kind": "CommonJS" } ], "directives": [] diff --git a/test/fixtures/flow/declare-module/import/expected.json b/test/fixtures/flow/declare-module/import/expected.json index 391e0de595..f1f57afa41 100644 --- a/test/fixtures/flow/declare-module/import/expected.json +++ b/test/fixtures/flow/declare-module/import/expected.json @@ -148,7 +148,8 @@ } } ] - } + }, + "kind": "CommonJS" } ], "directives": [] diff --git a/test/fixtures/flow/declare-module/invalid-commonjs-module/actual.js b/test/fixtures/flow/declare-module/invalid-commonjs-module/actual.js new file mode 100644 index 0000000000..094feacb53 --- /dev/null +++ b/test/fixtures/flow/declare-module/invalid-commonjs-module/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare module.exports: number; declare export var a: number; } diff --git a/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json b/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json new file mode 100644 index 0000000000..adfde32363 --- /dev/null +++ b/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module (1:55)" +} diff --git a/test/fixtures/flow/declare-module/invalid-es-module/actual.js b/test/fixtures/flow/declare-module/invalid-es-module/actual.js new file mode 100644 index 0000000000..111a0c6927 --- /dev/null +++ b/test/fixtures/flow/declare-module/invalid-es-module/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare export var a: number; declare module.exports: number; } diff --git a/test/fixtures/flow/declare-module/invalid-es-module/options.json b/test/fixtures/flow/declare-module/invalid-es-module/options.json new file mode 100644 index 0000000000..b40239a560 --- /dev/null +++ b/test/fixtures/flow/declare-module/invalid-es-module/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module (1:53)" +} diff --git a/test/fixtures/flow/declare-module/invalid-module-in-module/actual.js b/test/fixtures/flow/declare-module/invalid-module-in-module/actual.js new file mode 100644 index 0000000000..7b0be343c3 --- /dev/null +++ b/test/fixtures/flow/declare-module/invalid-module-in-module/actual.js @@ -0,0 +1 @@ +declare module A { declare module B {} } diff --git a/test/fixtures/flow/declare-module/invalid-module-in-module/options.json b/test/fixtures/flow/declare-module/invalid-module-in-module/options.json new file mode 100644 index 0000000000..cd823bd7c4 --- /dev/null +++ b/test/fixtures/flow/declare-module/invalid-module-in-module/options.json @@ -0,0 +1,3 @@ +{ + "throws": "`declare module` cannot be used inside another `declare module` (1:27)" +} diff --git a/test/fixtures/flow/declare-module/invalid-multiple-commonjs/actual.js b/test/fixtures/flow/declare-module/invalid-multiple-commonjs/actual.js new file mode 100644 index 0000000000..3c6d3a0307 --- /dev/null +++ b/test/fixtures/flow/declare-module/invalid-multiple-commonjs/actual.js @@ -0,0 +1 @@ +declare module "foo" { declare module.exports: string; declare module.exports: number; } diff --git a/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json b/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json new file mode 100644 index 0000000000..1520d766b0 --- /dev/null +++ b/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Duplicate `declare module.exports` statement (1:55)" +} diff --git a/test/fixtures/flow/declare-statements/10/expected.json b/test/fixtures/flow/declare-statements/10/expected.json index 2e0049fb41..378c963659 100644 --- a/test/fixtures/flow/declare-statements/10/expected.json +++ b/test/fixtures/flow/declare-statements/10/expected.json @@ -92,6 +92,25 @@ "column": 38 } }, + "key": { + "type": "Identifier", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": true, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 18, @@ -125,24 +144,6 @@ } } }, - "static": true, - "key": { - "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "foo" - }, - "name": "foo" - }, "optional": false }, { @@ -176,6 +177,8 @@ }, "name": "x" }, + "static": true, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 51, @@ -191,9 +194,8 @@ } } }, - "optional": false, - "static": true, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/declare-statements/15/expected.json b/test/fixtures/flow/declare-statements/15/expected.json index 0b5376ca37..6b3d9f0b04 100644 --- a/test/fixtures/flow/declare-statements/15/expected.json +++ b/test/fixtures/flow/declare-statements/15/expected.json @@ -109,6 +109,8 @@ }, "name": "foo" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 27, @@ -124,9 +126,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -247,6 +248,8 @@ }, "name": "foo" }, + "static": false, + "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 66, @@ -280,9 +283,8 @@ "name": "T" } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/declare-statements/17/expected.json b/test/fixtures/flow/declare-statements/17/expected.json index 381229ee19..2f4a6dc1cb 100644 --- a/test/fixtures/flow/declare-statements/17/expected.json +++ b/test/fixtures/flow/declare-statements/17/expected.json @@ -109,6 +109,8 @@ }, "name": "a" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 22, @@ -124,9 +126,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -159,6 +160,8 @@ }, "name": "b" }, + "static": true, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 41, @@ -174,9 +177,8 @@ } } }, - "optional": false, - "static": true, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -209,6 +211,8 @@ }, "name": "c" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 53, @@ -224,9 +228,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/declare-statements/7/expected.json b/test/fixtures/flow/declare-statements/7/expected.json index 776a6a6a9e..babd12a4f5 100644 --- a/test/fixtures/flow/declare-statements/7/expected.json +++ b/test/fixtures/flow/declare-statements/7/expected.json @@ -92,6 +92,25 @@ "column": 71 } }, + "key": { + "type": "Identifier", + "start": 29, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 39 + }, + "identifierName": "didAnimate" + }, + "name": "didAnimate" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 29, @@ -240,24 +259,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 29, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "didAnimate" - }, - "name": "didAnimate" - }, "optional": false } ], diff --git a/test/fixtures/flow/declare-statements/9/expected.json b/test/fixtures/flow/declare-statements/9/expected.json index 1ac09b01e8..3bafe9b3ab 100644 --- a/test/fixtures/flow/declare-statements/9/expected.json +++ b/test/fixtures/flow/declare-statements/9/expected.json @@ -225,6 +225,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 37, @@ -240,9 +242,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/declare-statements/invalid-literal/actual.js b/test/fixtures/flow/declare-statements/invalid-literal/actual.js new file mode 100644 index 0000000000..b70552565f --- /dev/null +++ b/test/fixtures/flow/declare-statements/invalid-literal/actual.js @@ -0,0 +1 @@ +declare 1; diff --git a/test/fixtures/flow/declare-statements/invalid-literal/options.json b/test/fixtures/flow/declare-statements/invalid-literal/options.json new file mode 100644 index 0000000000..1288082ab0 --- /dev/null +++ b/test/fixtures/flow/declare-statements/invalid-literal/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected ; (1:8)" +} diff --git a/test/fixtures/flow/interfaces-module-and-script/10/expected.json b/test/fixtures/flow/interfaces-module-and-script/10/expected.json index 4c7e6d03c9..4fb5918fb1 100644 --- a/test/fixtures/flow/interfaces-module-and-script/10/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/10/expected.json @@ -159,6 +159,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "BooleanTypeAnnotation", "start": 22, @@ -174,9 +176,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -209,6 +210,8 @@ }, "name": "y" }, + "static": true, + "kind": "init", "value": { "type": "BooleanTypeAnnotation", "start": 62, @@ -224,9 +227,8 @@ } } }, - "optional": false, - "static": true, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/interfaces-module-and-script/4/expected.json b/test/fixtures/flow/interfaces-module-and-script/4/expected.json index 1099bd54e8..83636e0555 100644 --- a/test/fixtures/flow/interfaces-module-and-script/4/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/4/expected.json @@ -109,6 +109,8 @@ }, "name": "foo" }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 19, @@ -142,9 +144,8 @@ }, "typeParameters": null }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/interfaces-module-and-script/5/expected.json b/test/fixtures/flow/interfaces-module-and-script/5/expected.json index 042154f2d0..da45e73fc6 100644 --- a/test/fixtures/flow/interfaces-module-and-script/5/expected.json +++ b/test/fixtures/flow/interfaces-module-and-script/5/expected.json @@ -109,6 +109,8 @@ }, "name": "length" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 56, @@ -124,9 +126,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [ diff --git a/test/fixtures/flow/object-types/invalid-getter-param-count/actual.js b/test/fixtures/flow/object-types/invalid-getter-param-count/actual.js new file mode 100644 index 0000000000..83d9b887fc --- /dev/null +++ b/test/fixtures/flow/object-types/invalid-getter-param-count/actual.js @@ -0,0 +1,3 @@ +type B = { + get a(foo:number): number; +} diff --git a/test/fixtures/flow/object-types/invalid-getter-param-count/options.json b/test/fixtures/flow/object-types/invalid-getter-param-count/options.json new file mode 100644 index 0000000000..8694117aee --- /dev/null +++ b/test/fixtures/flow/object-types/invalid-getter-param-count/options.json @@ -0,0 +1,3 @@ +{ + "throws": "getter should have no params (2:2)" +} diff --git a/test/fixtures/flow/object-types/invalid-setter-param-count/actual.js b/test/fixtures/flow/object-types/invalid-setter-param-count/actual.js new file mode 100644 index 0000000000..1ccbc71755 --- /dev/null +++ b/test/fixtures/flow/object-types/invalid-setter-param-count/actual.js @@ -0,0 +1,3 @@ +type B = { + set a(): void; +} diff --git a/test/fixtures/flow/object-types/invalid-setter-param-count/options.json b/test/fixtures/flow/object-types/invalid-setter-param-count/options.json new file mode 100644 index 0000000000..8ea95ab888 --- /dev/null +++ b/test/fixtures/flow/object-types/invalid-setter-param-count/options.json @@ -0,0 +1,3 @@ +{ + "throws": "setter should have exactly one param (2:2)" +} diff --git a/test/fixtures/flow/type-alias/4/expected.json b/test/fixtures/flow/type-alias/4/expected.json index 42a84bca7b..c45c0020b6 100644 --- a/test/fixtures/flow/type-alias/4/expected.json +++ b/test/fixtures/flow/type-alias/4/expected.json @@ -122,6 +122,8 @@ }, "name": "type" }, + "static": false, + "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 23, @@ -142,9 +144,8 @@ }, "value": "A" }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -197,6 +198,8 @@ }, "name": "type" }, + "static": false, + "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 38, @@ -217,9 +220,8 @@ }, "value": "B" }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -521,6 +523,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "UnionTypeAnnotation", "start": 147, @@ -583,6 +587,8 @@ }, "name": "type" }, + "static": false, + "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 156, @@ -603,9 +609,8 @@ }, "value": "A" }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -658,6 +663,8 @@ }, "name": "type" }, + "static": false, + "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 174, @@ -678,9 +685,8 @@ }, "value": "B" }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -688,9 +694,8 @@ } ] }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -776,6 +781,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "IntersectionTypeAnnotation", "start": 212, @@ -838,6 +845,8 @@ }, "name": "type" }, + "static": false, + "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 221, @@ -858,9 +867,8 @@ }, "value": "A" }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -913,6 +921,8 @@ }, "name": "type" }, + "static": false, + "kind": "init", "value": { "type": "StringLiteralTypeAnnotation", "start": 239, @@ -933,9 +943,8 @@ }, "value": "B" }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -943,9 +952,8 @@ } ] }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/108/expected.json b/test/fixtures/flow/type-annotations/108/expected.json index cc7cae44e2..54aad24d12 100644 --- a/test/fixtures/flow/type-annotations/108/expected.json +++ b/test/fixtures/flow/type-annotations/108/expected.json @@ -134,6 +134,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 14, @@ -149,9 +151,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -184,6 +185,8 @@ }, "name": "y" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 25, @@ -199,9 +202,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -446,6 +448,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 71, @@ -461,9 +465,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -496,6 +499,8 @@ }, "name": "y" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 82, @@ -511,9 +516,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -858,6 +862,8 @@ }, "name": "a" }, + "static": false, + "kind": "init", "value": { "type": "ObjectTypeAnnotation", "start": 148, @@ -905,6 +911,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 154, @@ -920,9 +928,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -955,6 +962,8 @@ }, "name": "y" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 165, @@ -970,17 +979,15 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], "exact": true }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -1013,6 +1020,8 @@ }, "name": "b" }, + "static": false, + "kind": "init", "value": { "type": "BooleanTypeAnnotation", "start": 179, @@ -1028,9 +1037,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -1378,6 +1386,8 @@ }, "name": "a" }, + "static": false, + "kind": "init", "value": { "type": "ObjectTypeAnnotation", "start": 242, @@ -1425,6 +1435,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 247, @@ -1440,9 +1452,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -1475,6 +1486,8 @@ }, "name": "y" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 258, @@ -1490,17 +1503,15 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], "exact": false }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -1533,6 +1544,8 @@ }, "name": "b" }, + "static": false, + "kind": "init", "value": { "type": "BooleanTypeAnnotation", "start": 271, @@ -1548,9 +1561,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/110/expected.json b/test/fixtures/flow/type-annotations/110/expected.json index f637eb85b6..063bbf7e97 100644 --- a/test/fixtures/flow/type-annotations/110/expected.json +++ b/test/fixtures/flow/type-annotations/110/expected.json @@ -107,6 +107,8 @@ }, "name": "p" }, + "static": false, + "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 13, @@ -140,8 +142,6 @@ "name": "T" } }, - "optional": false, - "static": false, "variance": { "type": "Variance", "start": 10, @@ -157,7 +157,8 @@ } }, "kind": "plus" - } + }, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/111/expected.json b/test/fixtures/flow/type-annotations/111/expected.json index 088ac9c758..02766a4758 100644 --- a/test/fixtures/flow/type-annotations/111/expected.json +++ b/test/fixtures/flow/type-annotations/111/expected.json @@ -107,6 +107,8 @@ }, "name": "p" }, + "static": false, + "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 13, @@ -140,8 +142,6 @@ "name": "T" } }, - "optional": false, - "static": false, "variance": { "type": "Variance", "start": 10, @@ -157,7 +157,8 @@ } }, "kind": "minus" - } + }, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/136/expected.json b/test/fixtures/flow/type-annotations/136/expected.json index ca0bd530db..6ccd7002c9 100644 --- a/test/fixtures/flow/type-annotations/136/expected.json +++ b/test/fixtures/flow/type-annotations/136/expected.json @@ -107,6 +107,8 @@ }, "name": "p" }, + "static": false, + "kind": "init", "value": { "type": "ObjectTypeAnnotation", "start": 15, @@ -126,9 +128,8 @@ "indexers": [], "exact": false }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeSpreadProperty", diff --git a/test/fixtures/flow/type-annotations/32/expected.json b/test/fixtures/flow/type-annotations/32/expected.json index ce82a0dbf1..2009fe86e1 100644 --- a/test/fixtures/flow/type-annotations/32/expected.json +++ b/test/fixtures/flow/type-annotations/32/expected.json @@ -134,6 +134,8 @@ }, "name": "numVal" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -149,9 +151,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/33/expected.json b/test/fixtures/flow/type-annotations/33/expected.json index 7739fea5f1..20c064ef1a 100644 --- a/test/fixtures/flow/type-annotations/33/expected.json +++ b/test/fixtures/flow/type-annotations/33/expected.json @@ -134,6 +134,8 @@ }, "name": "numVal" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -149,9 +151,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/34/expected.json b/test/fixtures/flow/type-annotations/34/expected.json index aa0ad93518..8214472aee 100644 --- a/test/fixtures/flow/type-annotations/34/expected.json +++ b/test/fixtures/flow/type-annotations/34/expected.json @@ -134,6 +134,8 @@ }, "name": "numVal" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -149,9 +151,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [ diff --git a/test/fixtures/flow/type-annotations/35/expected.json b/test/fixtures/flow/type-annotations/35/expected.json index 226236359b..0a016d2518 100644 --- a/test/fixtures/flow/type-annotations/35/expected.json +++ b/test/fixtures/flow/type-annotations/35/expected.json @@ -148,6 +148,8 @@ }, "name": "numVal" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 17, @@ -163,9 +165,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/36/expected.json b/test/fixtures/flow/type-annotations/36/expected.json index 4ccc7c692f..31e1d58d02 100644 --- a/test/fixtures/flow/type-annotations/36/expected.json +++ b/test/fixtures/flow/type-annotations/36/expected.json @@ -134,6 +134,8 @@ }, "name": "numVal" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -149,9 +151,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -184,6 +185,8 @@ }, "name": "strVal" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 32, @@ -199,9 +202,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/37/expected.json b/test/fixtures/flow/type-annotations/37/expected.json index ef13a1423d..5c4dbc804f 100644 --- a/test/fixtures/flow/type-annotations/37/expected.json +++ b/test/fixtures/flow/type-annotations/37/expected.json @@ -134,6 +134,8 @@ }, "name": "subObj" }, + "static": false, + "kind": "init", "value": { "type": "ObjectTypeAnnotation", "start": 16, @@ -181,6 +183,8 @@ }, "name": "strVal" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 25, @@ -196,17 +200,15 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], "exact": false }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/38/expected.json b/test/fixtures/flow/type-annotations/38/expected.json index a37a224c5e..13365bd73e 100644 --- a/test/fixtures/flow/type-annotations/38/expected.json +++ b/test/fixtures/flow/type-annotations/38/expected.json @@ -134,6 +134,8 @@ }, "name": "subObj" }, + "static": false, + "kind": "init", "value": { "type": "NullableTypeAnnotation", "start": 16, @@ -195,6 +197,8 @@ }, "name": "strVal" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 26, @@ -210,18 +214,16 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], "exact": false } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/39/expected.json b/test/fixtures/flow/type-annotations/39/expected.json index ba0346f3e3..ff7898371e 100644 --- a/test/fixtures/flow/type-annotations/39/expected.json +++ b/test/fixtures/flow/type-annotations/39/expected.json @@ -134,6 +134,8 @@ }, "name": "param1" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -149,9 +151,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -184,6 +185,8 @@ }, "name": "param2" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 32, @@ -199,9 +202,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/40/expected.json b/test/fixtures/flow/type-annotations/40/expected.json index bd5b46e71f..fc457a1df3 100644 --- a/test/fixtures/flow/type-annotations/40/expected.json +++ b/test/fixtures/flow/type-annotations/40/expected.json @@ -134,6 +134,8 @@ }, "name": "param1" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -149,9 +151,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -184,6 +185,8 @@ }, "name": "param2" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 33, @@ -199,9 +202,8 @@ } } }, - "optional": true, - "static": false, - "variance": null + "variance": null, + "optional": true } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/42/expected.json b/test/fixtures/flow/type-annotations/42/expected.json index c02588c4e6..71e3447c35 100644 --- a/test/fixtures/flow/type-annotations/42/expected.json +++ b/test/fixtures/flow/type-annotations/42/expected.json @@ -117,6 +117,25 @@ "column": 47 } }, + "key": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "add" + }, + "name": "add" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 8, @@ -295,24 +314,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "add" - }, - "name": "add" - }, "optional": false } ], diff --git a/test/fixtures/flow/type-annotations/43/expected.json b/test/fixtures/flow/type-annotations/43/expected.json index d888673773..07ba5008e4 100644 --- a/test/fixtures/flow/type-annotations/43/expected.json +++ b/test/fixtures/flow/type-annotations/43/expected.json @@ -117,6 +117,25 @@ "column": 23 } }, + "key": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "id" + }, + "name": "id" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 9, @@ -268,24 +287,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "id" - }, - "name": "id" - }, "optional": false } ], diff --git a/test/fixtures/flow/type-annotations/60/expected.json b/test/fixtures/flow/type-annotations/60/expected.json index 71d0a6e5f9..7bcec9cc23 100644 --- a/test/fixtures/flow/type-annotations/60/expected.json +++ b/test/fixtures/flow/type-annotations/60/expected.json @@ -189,6 +189,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 13, @@ -204,9 +206,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/61/expected.json b/test/fixtures/flow/type-annotations/61/expected.json index b08974f765..d67405b5b2 100644 --- a/test/fixtures/flow/type-annotations/61/expected.json +++ b/test/fixtures/flow/type-annotations/61/expected.json @@ -189,6 +189,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 13, @@ -204,9 +206,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/63/expected.json b/test/fixtures/flow/type-annotations/63/expected.json index e0bbfe124f..9317604671 100644 --- a/test/fixtures/flow/type-annotations/63/expected.json +++ b/test/fixtures/flow/type-annotations/63/expected.json @@ -195,6 +195,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 23, @@ -210,9 +212,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-annotations/98/expected.json b/test/fixtures/flow/type-annotations/98/expected.json index 7100fa77f8..0b51971251 100644 --- a/test/fixtures/flow/type-annotations/98/expected.json +++ b/test/fixtures/flow/type-annotations/98/expected.json @@ -134,6 +134,8 @@ }, "name": "param1" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 17, @@ -149,9 +151,8 @@ } } }, - "optional": true, - "static": false, - "variance": null + "variance": null, + "optional": true }, { "type": "ObjectTypeProperty", @@ -184,6 +185,8 @@ }, "name": "param2" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 33, @@ -199,9 +202,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -234,6 +236,8 @@ }, "name": "param3" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 49, @@ -249,9 +253,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-exports/interface/expected.json b/test/fixtures/flow/type-exports/interface/expected.json index 45366de3c4..f835d903ed 100644 --- a/test/fixtures/flow/type-exports/interface/expected.json +++ b/test/fixtures/flow/type-exports/interface/expected.json @@ -126,6 +126,8 @@ }, "name": "p" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 26, @@ -141,9 +143,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -297,6 +298,8 @@ }, "name": "p" }, + "static": false, + "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 65, @@ -330,9 +333,8 @@ "name": "T" } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], diff --git a/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json index df4896c159..c70f16d94e 100644 --- a/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/expected.json @@ -92,6 +92,25 @@ "column": 19 } }, + "key": { + "type": "Identifier", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "foobar" + }, + "name": "foobar" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 20, @@ -158,24 +177,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "foobar" - }, - "name": "foobar" - }, "optional": false }, { @@ -192,6 +193,25 @@ "column": 19 } }, + "key": { + "type": "Identifier", + "start": 41, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "delete" + }, + "name": "delete" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 41, @@ -258,24 +278,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "delete" - }, - "name": "delete" - }, "optional": false }, { @@ -292,6 +294,25 @@ "column": 18 } }, + "key": { + "type": "Identifier", + "start": 62, + "end": 67, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 7 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 62, @@ -358,24 +379,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 62, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, - "name": "yield" - }, "optional": false }, { @@ -392,6 +395,25 @@ "column": 15 } }, + "key": { + "type": "Identifier", + "start": 82, + "end": 84, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 4 + }, + "identifierName": "do" + }, + "name": "do" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 82, @@ -458,24 +480,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 82, - "end": 84, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "do" - }, - "name": "do" - }, "optional": false }, { @@ -492,6 +496,25 @@ "column": 26 } }, + "key": { + "type": "Identifier", + "start": 106, + "end": 112, + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 15 + }, + "identifierName": "foobar" + }, + "name": "foobar" + }, + "static": true, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 99, @@ -558,24 +581,6 @@ } } }, - "static": true, - "key": { - "type": "Identifier", - "start": 106, - "end": 112, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 15 - }, - "identifierName": "foobar" - }, - "name": "foobar" - }, "optional": false }, { @@ -592,6 +597,25 @@ "column": 26 } }, + "key": { + "type": "Identifier", + "start": 134, + "end": 140, + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 15 + }, + "identifierName": "delete" + }, + "name": "delete" + }, + "static": true, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 127, @@ -658,24 +682,6 @@ } } }, - "static": true, - "key": { - "type": "Identifier", - "start": 134, - "end": 140, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 15 - }, - "identifierName": "delete" - }, - "name": "delete" - }, "optional": false }, { @@ -692,6 +698,25 @@ "column": 25 } }, + "key": { + "type": "Identifier", + "start": 162, + "end": 167, + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 14 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "static": true, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 155, @@ -758,24 +783,6 @@ } } }, - "static": true, - "key": { - "type": "Identifier", - "start": 162, - "end": 167, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 14 - }, - "identifierName": "yield" - }, - "name": "yield" - }, "optional": false }, { @@ -792,6 +799,25 @@ "column": 22 } }, + "key": { + "type": "Identifier", + "start": 189, + "end": 191, + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 11 + }, + "identifierName": "do" + }, + "name": "do" + }, + "static": true, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 182, @@ -858,24 +884,6 @@ } } }, - "static": true, - "key": { - "type": "Identifier", - "start": 189, - "end": 191, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 11 - }, - "identifierName": "do" - }, - "name": "do" - }, "optional": false } ], diff --git a/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json index d6ee0660f0..1bc3f578c1 100644 --- a/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/expected.json @@ -92,6 +92,25 @@ "column": 19 } }, + "key": { + "type": "Identifier", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "foobar" + }, + "name": "foobar" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 24, @@ -158,24 +177,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "foobar" - }, - "name": "foobar" - }, "optional": false }, { @@ -192,6 +193,25 @@ "column": 19 } }, + "key": { + "type": "Identifier", + "start": 45, + "end": 51, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "delete" + }, + "name": "delete" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 45, @@ -258,24 +278,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 45, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "delete" - }, - "name": "delete" - }, "optional": false }, { @@ -292,6 +294,25 @@ "column": 18 } }, + "key": { + "type": "Identifier", + "start": 66, + "end": 71, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 7 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 66, @@ -358,24 +379,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 66, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, - "name": "yield" - }, "optional": false }, { @@ -392,6 +395,25 @@ "column": 15 } }, + "key": { + "type": "Identifier", + "start": 86, + "end": 88, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 4 + }, + "identifierName": "do" + }, + "name": "do" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 86, @@ -458,24 +480,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 86, - "end": 88, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "do" - }, - "name": "do" - }, "optional": false } ], diff --git a/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json index d14c0aa7a3..42e5d3ce8b 100644 --- a/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/expected.json @@ -92,6 +92,25 @@ "column": 19 } }, + "key": { + "type": "Identifier", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "foobar" + }, + "name": "foobar" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 16, @@ -158,24 +177,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "foobar" - }, - "name": "foobar" - }, "optional": false }, { @@ -192,6 +193,25 @@ "column": 19 } }, + "key": { + "type": "Identifier", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "delete" + }, + "name": "delete" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 37, @@ -258,24 +278,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "delete" - }, - "name": "delete" - }, "optional": false }, { @@ -292,6 +294,25 @@ "column": 18 } }, + "key": { + "type": "Identifier", + "start": 58, + "end": 63, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 7 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 58, @@ -358,24 +379,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 58, - "end": 63, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, - "name": "yield" - }, "optional": false }, { @@ -392,6 +395,25 @@ "column": 15 } }, + "key": { + "type": "Identifier", + "start": 78, + "end": 80, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 4 + }, + "identifierName": "do" + }, + "name": "do" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 78, @@ -458,24 +480,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 78, - "end": 80, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "do" - }, - "name": "do" - }, "optional": false } ], diff --git a/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json b/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json index c3bb865167..5847ba7708 100644 --- a/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/expected.json @@ -90,6 +90,25 @@ "column": 19 } }, + "key": { + "type": "Identifier", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "foobar" + }, + "name": "foobar" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 13, @@ -156,24 +175,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "foobar" - }, - "name": "foobar" - }, "optional": false }, { @@ -190,6 +191,25 @@ "column": 19 } }, + "key": { + "type": "Identifier", + "start": 34, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "delete" + }, + "name": "delete" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 34, @@ -256,24 +276,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "delete" - }, - "name": "delete" - }, "optional": false }, { @@ -290,6 +292,25 @@ "column": 18 } }, + "key": { + "type": "Identifier", + "start": 55, + "end": 60, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 7 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 55, @@ -356,24 +377,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 55, - "end": 60, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, - "name": "yield" - }, "optional": false }, { @@ -390,6 +393,25 @@ "column": 15 } }, + "key": { + "type": "Identifier", + "start": 75, + "end": 77, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 4 + }, + "identifierName": "do" + }, + "name": "do" + }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 75, @@ -456,24 +478,6 @@ } } }, - "static": false, - "key": { - "type": "Identifier", - "start": 75, - "end": 77, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "do" - }, - "name": "do" - }, "optional": false } ], diff --git a/test/fixtures/flow/typecasts/2/expected.json b/test/fixtures/flow/typecasts/2/expected.json index e9f527ccb8..e41a4f7b34 100644 --- a/test/fixtures/flow/typecasts/2/expected.json +++ b/test/fixtures/flow/typecasts/2/expected.json @@ -244,6 +244,8 @@ }, "name": "xxx" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 29, @@ -259,9 +261,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -294,6 +295,8 @@ }, "name": "yyy" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 42, @@ -309,9 +312,8 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], From 00d6db9fbb712e26f72d4fd5a5abe82b7754b0fe Mon Sep 17 00:00:00 2001 From: Alex Kuzmenko Date: Fri, 21 Apr 2017 16:22:50 +0300 Subject: [PATCH 088/105] Fixed invalid number literal parsing (#473) * Fixed invalid number literal parsing * Don't ignore period or E characters after octal numbers cherry-pick fix from acorn * Fix tests --- src/tokenizer/index.js | 12 ++++++++---- test/fixtures/core/uncategorised/554/actual.js | 1 + test/fixtures/core/uncategorised/554/options.json | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 test/fixtures/core/uncategorised/554/actual.js create mode 100644 test/fixtures/core/uncategorised/554/options.json diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index b9137487ef..74f03f3088 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -582,30 +582,34 @@ export default class Tokenizer { readNumber(startsWithDot: boolean): void { const start = this.state.pos; - const firstIsZero = this.input.charCodeAt(start) === 48; // '0' + let octal = this.input.charCodeAt(start) === 48; // '0' let isFloat = false; if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number"); + if (octal && this.state.pos == start + 1) octal = false; // number === 0 + let next = this.input.charCodeAt(this.state.pos); - if (next === 46) { // '.' + if (next === 46 && !octal) { // '.' ++this.state.pos; this.readInt(10); isFloat = true; next = this.input.charCodeAt(this.state.pos); } - if (next === 69 || next === 101) { // 'eE' + + if ((next === 69 || next === 101) && !octal) { // 'eE' next = this.input.charCodeAt(++this.state.pos); if (next === 43 || next === 45) ++this.state.pos; // '+-' if (this.readInt(10) === null) this.raise(start, "Invalid number"); isFloat = true; } + if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly after number"); const str = this.input.slice(start, this.state.pos); let val; if (isFloat) { val = parseFloat(str); - } else if (!firstIsZero || str.length === 1) { + } else if (!octal || str.length === 1) { val = parseInt(str, 10); } else if (this.state.strict) { this.raise(start, "Invalid number"); diff --git a/test/fixtures/core/uncategorised/554/actual.js b/test/fixtures/core/uncategorised/554/actual.js new file mode 100644 index 0000000000..204735a64f --- /dev/null +++ b/test/fixtures/core/uncategorised/554/actual.js @@ -0,0 +1 @@ +var a = 0123.; \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/554/options.json b/test/fixtures/core/uncategorised/554/options.json new file mode 100644 index 0000000000..e247a786c1 --- /dev/null +++ b/test/fixtures/core/uncategorised/554/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:13)" +} From d975b91a5408ef78f7cf18594a07812f12c03252 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 21 Apr 2017 06:59:46 -0700 Subject: [PATCH 089/105] Refresh property ordering in baselines (#454) --- test/fixtures/flow/literal-types/string-double/expected.json | 2 +- test/fixtures/flow/literal-types/string-single/expected.json | 2 +- test/fixtures/flow/type-annotations/100/expected.json | 2 +- test/fixtures/flow/type-annotations/12/expected.json | 2 +- test/fixtures/flow/type-annotations/13/expected.json | 2 +- test/fixtures/flow/type-annotations/130/expected.json | 2 +- test/fixtures/flow/type-annotations/14/expected.json | 2 +- test/fixtures/flow/type-annotations/15/expected.json | 2 +- test/fixtures/flow/type-annotations/16/expected.json | 2 +- test/fixtures/flow/type-annotations/21/expected.json | 2 +- test/fixtures/flow/type-annotations/22/expected.json | 2 +- test/fixtures/flow/type-annotations/23/expected.json | 2 +- test/fixtures/flow/type-annotations/24/expected.json | 2 +- test/fixtures/flow/type-annotations/25/expected.json | 2 +- test/fixtures/flow/type-annotations/26/expected.json | 2 +- test/fixtures/flow/type-annotations/28/expected.json | 2 +- test/fixtures/flow/type-annotations/29/expected.json | 2 +- test/fixtures/flow/type-annotations/50/expected.json | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/fixtures/flow/literal-types/string-double/expected.json b/test/fixtures/flow/literal-types/string-double/expected.json index 97893a5689..010fa630f4 100644 --- a/test/fixtures/flow/literal-types/string-double/expected.json +++ b/test/fixtures/flow/literal-types/string-double/expected.json @@ -116,6 +116,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 38, @@ -164,7 +165,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 55, diff --git a/test/fixtures/flow/literal-types/string-single/expected.json b/test/fixtures/flow/literal-types/string-single/expected.json index bbdf5f7e6c..bd14fc10ac 100644 --- a/test/fixtures/flow/literal-types/string-single/expected.json +++ b/test/fixtures/flow/literal-types/string-single/expected.json @@ -116,6 +116,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 38, @@ -164,7 +165,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 55, diff --git a/test/fixtures/flow/type-annotations/100/expected.json b/test/fixtures/flow/type-annotations/100/expected.json index dee215f26f..a0e6a89d2c 100644 --- a/test/fixtures/flow/type-annotations/100/expected.json +++ b/test/fixtures/flow/type-annotations/100/expected.json @@ -114,6 +114,7 @@ "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 17, @@ -145,7 +146,6 @@ "value": true } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 23, diff --git a/test/fixtures/flow/type-annotations/12/expected.json b/test/fixtures/flow/type-annotations/12/expected.json index 8643321a36..22f2c3c9df 100644 --- a/test/fixtures/flow/type-annotations/12/expected.json +++ b/test/fixtures/flow/type-annotations/12/expected.json @@ -63,6 +63,7 @@ "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -93,7 +94,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 21, diff --git a/test/fixtures/flow/type-annotations/13/expected.json b/test/fixtures/flow/type-annotations/13/expected.json index 79007cd2cd..3a78824d22 100644 --- a/test/fixtures/flow/type-annotations/13/expected.json +++ b/test/fixtures/flow/type-annotations/13/expected.json @@ -63,6 +63,7 @@ "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -111,7 +112,6 @@ "typeParameters": null } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 25, diff --git a/test/fixtures/flow/type-annotations/130/expected.json b/test/fixtures/flow/type-annotations/130/expected.json index 8fd8731f5c..15ad52dcb9 100644 --- a/test/fixtures/flow/type-annotations/130/expected.json +++ b/test/fixtures/flow/type-annotations/130/expected.json @@ -242,6 +242,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 34, @@ -272,7 +273,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 43, diff --git a/test/fixtures/flow/type-annotations/14/expected.json b/test/fixtures/flow/type-annotations/14/expected.json index 9368eb0561..807aa5b5a4 100644 --- a/test/fixtures/flow/type-annotations/14/expected.json +++ b/test/fixtures/flow/type-annotations/14/expected.json @@ -63,6 +63,7 @@ "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -160,7 +161,6 @@ "typeParameters": null } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 33, diff --git a/test/fixtures/flow/type-annotations/15/expected.json b/test/fixtures/flow/type-annotations/15/expected.json index 3e0cbfc4ee..9d52a5cde3 100644 --- a/test/fixtures/flow/type-annotations/15/expected.json +++ b/test/fixtures/flow/type-annotations/15/expected.json @@ -63,6 +63,7 @@ "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -160,7 +161,6 @@ "typeParameters": null } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 34, diff --git a/test/fixtures/flow/type-annotations/16/expected.json b/test/fixtures/flow/type-annotations/16/expected.json index 16a7f500d7..51bc95587f 100644 --- a/test/fixtures/flow/type-annotations/16/expected.json +++ b/test/fixtures/flow/type-annotations/16/expected.json @@ -63,6 +63,7 @@ "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -97,7 +98,6 @@ "exact": false } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 19, diff --git a/test/fixtures/flow/type-annotations/21/expected.json b/test/fixtures/flow/type-annotations/21/expected.json index 11ac28aa29..c5d4df45b5 100644 --- a/test/fixtures/flow/type-annotations/21/expected.json +++ b/test/fixtures/flow/type-annotations/21/expected.json @@ -178,6 +178,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 28, @@ -208,7 +209,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 33, diff --git a/test/fixtures/flow/type-annotations/22/expected.json b/test/fixtures/flow/type-annotations/22/expected.json index 7e408c0077..3cbd6273d8 100644 --- a/test/fixtures/flow/type-annotations/22/expected.json +++ b/test/fixtures/flow/type-annotations/22/expected.json @@ -130,6 +130,7 @@ "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 16, @@ -160,7 +161,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 23, diff --git a/test/fixtures/flow/type-annotations/23/expected.json b/test/fixtures/flow/type-annotations/23/expected.json index a0d584a412..05b77ef383 100644 --- a/test/fixtures/flow/type-annotations/23/expected.json +++ b/test/fixtures/flow/type-annotations/23/expected.json @@ -195,6 +195,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -243,7 +244,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 18, diff --git a/test/fixtures/flow/type-annotations/24/expected.json b/test/fixtures/flow/type-annotations/24/expected.json index bef2f718ee..ffb6d1e92c 100644 --- a/test/fixtures/flow/type-annotations/24/expected.json +++ b/test/fixtures/flow/type-annotations/24/expected.json @@ -195,6 +195,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 15, @@ -243,7 +244,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 19, diff --git a/test/fixtures/flow/type-annotations/25/expected.json b/test/fixtures/flow/type-annotations/25/expected.json index 17b2ed9260..cdf03fcf78 100644 --- a/test/fixtures/flow/type-annotations/25/expected.json +++ b/test/fixtures/flow/type-annotations/25/expected.json @@ -195,6 +195,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 20, @@ -243,7 +244,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 24, diff --git a/test/fixtures/flow/type-annotations/26/expected.json b/test/fixtures/flow/type-annotations/26/expected.json index 3a317643db..9a5cf1d754 100644 --- a/test/fixtures/flow/type-annotations/26/expected.json +++ b/test/fixtures/flow/type-annotations/26/expected.json @@ -198,6 +198,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 15, @@ -246,7 +247,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 19, diff --git a/test/fixtures/flow/type-annotations/28/expected.json b/test/fixtures/flow/type-annotations/28/expected.json index c67f48e7ca..4dc6a8495b 100644 --- a/test/fixtures/flow/type-annotations/28/expected.json +++ b/test/fixtures/flow/type-annotations/28/expected.json @@ -162,6 +162,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 36, @@ -192,7 +193,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 41, diff --git a/test/fixtures/flow/type-annotations/29/expected.json b/test/fixtures/flow/type-annotations/29/expected.json index 47b047f5d5..14dda0a969 100644 --- a/test/fixtures/flow/type-annotations/29/expected.json +++ b/test/fixtures/flow/type-annotations/29/expected.json @@ -114,6 +114,7 @@ "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 24, @@ -144,7 +145,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 31, diff --git a/test/fixtures/flow/type-annotations/50/expected.json b/test/fixtures/flow/type-annotations/50/expected.json index 8ca1334648..2682c49d27 100644 --- a/test/fixtures/flow/type-annotations/50/expected.json +++ b/test/fixtures/flow/type-annotations/50/expected.json @@ -182,6 +182,7 @@ "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 23, @@ -212,7 +213,6 @@ } } }, - "predicate": null, "body": { "type": "BlockStatement", "start": 31, From bc0719a1455d351f25aa66a1fdbebccfa992d038 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 21 Apr 2017 09:25:34 -0500 Subject: [PATCH 090/105] Ensure non pattern shorthand props are checked for reserved words (#479) --- src/parser/expression.js | 3 ++- test/fixtures/es2015/shorthand/1/actual.js | 1 + test/fixtures/es2015/shorthand/1/options.json | 3 +++ test/fixtures/es2015/shorthand/2/actual.js | 1 + test/fixtures/es2015/shorthand/2/options.json | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/es2015/shorthand/1/actual.js create mode 100644 test/fixtures/es2015/shorthand/1/options.json create mode 100644 test/fixtures/es2015/shorthand/2/actual.js create mode 100644 test/fixtures/es2015/shorthand/2/options.json diff --git a/src/parser/expression.js b/src/parser/expression.js index aeb6464f8d..e813460314 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -878,8 +878,9 @@ pp.parseObjectProperty = function (prop, startPos, startLoc, isPattern, refShort } if (!prop.computed && prop.key.type === "Identifier") { + this.checkReservedWord(prop.key.name, prop.key.start, true, true); + if (isPattern) { - this.checkReservedWord(prop.key.name, prop.key.start, true, true); prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); } else if (this.match(tt.eq) && refShorthandDefaultPos) { if (!refShorthandDefaultPos.start) { diff --git a/test/fixtures/es2015/shorthand/1/actual.js b/test/fixtures/es2015/shorthand/1/actual.js new file mode 100644 index 0000000000..5ce7c9deac --- /dev/null +++ b/test/fixtures/es2015/shorthand/1/actual.js @@ -0,0 +1 @@ +var x = ({ const }); diff --git a/test/fixtures/es2015/shorthand/1/options.json b/test/fixtures/es2015/shorthand/1/options.json new file mode 100644 index 0000000000..a618f5e2ef --- /dev/null +++ b/test/fixtures/es2015/shorthand/1/options.json @@ -0,0 +1,3 @@ +{ + "throws": "const is a reserved word (1:11)" +} diff --git a/test/fixtures/es2015/shorthand/2/actual.js b/test/fixtures/es2015/shorthand/2/actual.js new file mode 100644 index 0000000000..fabf36837d --- /dev/null +++ b/test/fixtures/es2015/shorthand/2/actual.js @@ -0,0 +1 @@ +({ get, this, if }); diff --git a/test/fixtures/es2015/shorthand/2/options.json b/test/fixtures/es2015/shorthand/2/options.json new file mode 100644 index 0000000000..7691eb820f --- /dev/null +++ b/test/fixtures/es2015/shorthand/2/options.json @@ -0,0 +1,3 @@ +{ + "throws": "this is a reserved word (1:8)" +} From 8601f2f7da8285a49d5d7d3fb3bf76e096668e74 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 21 Apr 2017 10:48:09 -0700 Subject: [PATCH 091/105] Add type declarations for AST nodes (#480) --- src/types.js | 706 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 706 insertions(+) create mode 100644 src/types.js diff --git a/src/types.js b/src/types.js new file mode 100644 index 0000000000..d7d4f388f5 --- /dev/null +++ b/src/types.js @@ -0,0 +1,706 @@ +// @flow + +import type { Token } from "./tokenizer"; +import type { SourceLocation } from "./util/location"; + +/* + * If making any changes to the AST, update: + * - This repository: + * - This file + * - `ast` directory + * - Babel repository: + * - packages/babel-types/src/definitions + * - packages/babel-generators/src/generators + */ + +export type Comment = { + type: "CommentBlock" | "CommentLine"; + value: string; + start: number; + end: number; + loc: SourceLocation; +}; + +export interface NodeBase { + start: number; + end: number; + loc: SourceLocation; + range: [number, number]; + leadingComments?: ?Array; + trailingComments?: ?Array; + innerComments?: ?Array; + + extra: { [key: string]: any }; +} + +// Using a union type for `Node` makes type-checking too slow. +// Instead, add an index signature to allow a Node to be treated as anything. +export type Node = NodeBase & { [key: string]: any }; +export type Expression = Node; +export type Statement = Node; +export type Pattern = + | Identifier + | ObjectPattern + | ArrayPattern + | RestElement + | AssignmentPattern; +export type Declaration = + | VariableDeclaration + | ClassDeclaration + | FunctionDeclaration; +export type DeclarationBase = NodeBase; + +// TODO: Not in spec +export type HasDecorators = NodeBase & { + decorators?: $ReadOnlyArray; +}; + +export type Identifier = PatternBase & { + type: "Identifier"; + name: string; + + __clone(): Identifier; +}; + +// Literals + +export type Literal = RegExpLiteral | NullLiteral | StringLiteral | BooleanLiteral | NumericLiteral; + +export type RegExpLiteral = NodeBase & { + type: "RegExpLiteral"; + pattern: string; + flags: RegExp$flags; +}; + +export type NullLiteral = NodeBase & { + type: "NullLiteral"; +} + +export type StringLiteral = NodeBase & { + type: "StringLiteral"; + value: string; +}; + +export type BooleanLiteral = NodeBase & { + type: "BooleanLiteral"; + value: boolean; +}; + +export type NumericLiteral = NodeBase & { + type: "NumericLiteral"; + value: number; +}; + +// Programs + +export type BlockStatementLike = Program | BlockStatement; + +export type File = NodeBase & { + type: "File"; + program: Program; + comments: $ReadOnlyArray; + tokens: $ReadOnlyArray; +}; + +export type Program = NodeBase & { + type: "Program"; + sourceType: "script" | "module"; + body: Array; // TODO: $ReadOnlyArray + directives: $ReadOnlyArray; // TODO: Not in spec +}; + +// Functions + +export type Function = + NormalFunction | ArrowFunctionExpression | ObjectMethod | ClassMethod; + +export type NormalFunction = + FunctionDeclaration | FunctionExpression; + +export type FunctionBase = HasDecorators & { + id: ?Identifier; + params: $ReadOnlyArray; + body: BlockStatement; + generator: boolean; + async: boolean; + + expression: boolean; // TODO: Not in spec + typeParameters?: ?FlowTypeParameterDeclaration; // TODO: Not in spec + returnType?: ?FlowTypeAnnotation; // TODO: Not in spec +}; + +// Statements + +export type ExpressionStatement = NodeBase & { + type: "ExpressionStatement"; + expression: Expression; +}; + +export type BlockStatement = NodeBase & { + type: "BlockStatement"; + body: Array; // TODO: $ReadOnlyArray + directives: $ReadOnlyArray; +}; + +export type EmptyStatement = NodeBase & { + type: "EmptyStatement" +}; + +export type DebuggerStatement = NodeBase & { + type: "DebuggerStatement" +}; + +export type WithStatement = NodeBase & { + type: "WithStatement"; + object: Expression; + body: Statement; +}; + +export type ReturnStatement = NodeBase & { + type: "ReturnStatement"; + argument: ?Expression; +}; + +export type LabeledStatement = NodeBase & { + type: "LabeledStatement"; + label: Identifier; + body: Statement; +}; + +export type BreakStatement = NodeBase & { + type: "BreakStatement"; + label: ?Identifier; +}; + +export type ContinueStatement = NodeBase & { + type: "ContinueStatement"; + label: ?Identifier; +}; + +// Choice + +export type IfStatement = NodeBase & { + type: "IfStatement"; + test: Expression; + consequent: Statement; + alternate: ?Statement; +}; + +export type SwitchStatement = NodeBase & { + type: "SwitchStatement"; + discriminant: Expression; + cases: $ReadOnlyArray; +}; + +export type SwitchCase = NodeBase & { + type: "SwitchCase"; + test: ?Expression; + consequent: $ReadOnlyArray; +}; + +// Exceptions + +export type ThrowStatement = NodeBase & { + type: "ThrowStatement"; + argument: Expression; +}; + +export type TryStatement = NodeBase & { + type: "TryStatement"; + block: BlockStatement; + handler: CatchClause | null; + finalizer: BlockStatement | null; + + guardedHandlers: $ReadOnlyArray; // TODO: Not in spec +}; + +export type CatchClause = NodeBase & { + type: "CatchClause"; + param: Pattern; + body: BlockStatement; +}; + +// Loops + +export type WhileStatement = NodeBase & { + type: "WhileStatement"; + test: Expression; + body: Statement; +}; + +export type DoWhileStatement = NodeBase & { + type: "DoWhileStatement"; + body: Statement; + test: Expression; +}; + +export type ForLike = ForStatement | ForInOf; + +export type ForStatement = NodeBase & { + type: "ForStatement"; + init: ?(VariableDeclaration | Expression); + test: ?Expression; + update: ?Expression; + body: Statement; +}; + +export type ForInOf = ForInStatement | ForOfStatement; + +export type ForInOfBase = NodeBase & { + type: "ForInStatement"; + left: VariableDeclaration | Expression; + right: Expression; + body: Statement; +}; + +export type ForInStatement = ForInOfBase & { + type: "ForInStatement"; + // TODO: Shouldn't be here, but have to declare it because it's assigned to a ForInOf unconditionally. + await: boolean; +}; + +export type ForOfStatement = ForInOfBase & { + type: "ForOfStatement"; + await: boolean; +}; + +// Declarations + +export type FunctionDeclaration = FunctionBase & DeclarationBase & HasDecorators & { + type: "FunctionDeclaration"; + id: Identifier; +}; + +export type VariableDeclaration = DeclarationBase & HasDecorators & { + type: "VariableDeclaration"; + declarations: $ReadOnlyArray; + kind: "var" | "let" | "const"; +}; + +export type VariableDeclarator = NodeBase & { + type: "VariableDeclarator"; + id: Pattern; + init: ?Expression; +}; + +// Misc + +export type Decorator = NodeBase & { + type: "Decorator"; + expression: Expression; +}; + +export type Directive = NodeBase & { + type: "Directive"; + value: DirectiveLiteral; +}; + +export type DirectiveLiteral = StringLiteral & { type: "DirectiveLiteral" }; + +// Expressions + +export type Super = NodeBase & { type: "Super" }; + +export type Import = NodeBase & { type: "Import" }; + +export type ThisExpression = NodeBase & { type: "ThisExpression" }; + +export type ArrowFunctionExpression = FunctionBase & { + type: "ArrowFunctionExpression"; + body: BlockStatement | Expression; +}; + +export type YieldExpression = NodeBase & { + type: "YieldExpression"; + argument: ?Expression; + delegate: boolean; +}; + +export type AwaitExpression = NodeBase & { + type: "AwaitExpression"; + argument: ?Expression; +}; + +export type ArrayExpression = NodeBase & { + type: "ArrayExpression"; + elements: $ReadOnlyArray; +}; + +export type ObjectExpression = NodeBase & { + type: "ObjectExpression"; + properties: $ReadOnlyArray; +}; + +export type ObjectOrClassMember = ClassMethod | ClassProperty | ObjectMember; + +export type ObjectMember = ObjectProperty | ObjectMethod; + +export type ObjectMemberBase = NodeBase & { + key: Expression; + computed: boolean; + value: Expression; + decorators: $ReadOnlyArray; + kind?: "get" | "set" | "method"; + method: boolean; // TODO: Not in spec + + variance?: ?FlowVariance; // TODO: Not in spec +}; + +export type ObjectProperty = ObjectMemberBase & { + type: "ObjectProperty"; + shorthand: boolean; +}; + +export type ObjectMethod = ObjectMemberBase & MethodBase & { + type: "ObjectMethod"; + kind: "get" | "set" | "method"; // Never "constructor" +}; + +export type FunctionExpression = MethodBase & { + kind?: void; // never set + type: "FunctionExpression"; +}; + +// Unary operations + +export type UnaryExpression = NodeBase & { + type: "UnaryExpression"; + operator: UnaryOperator; + prefix: boolean; + argument: Expression; +}; + +export type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"; + +export type UpdateExpression = NodeBase & { + type: "UpdateExpression"; + operator: UpdateOperator; + argument: Expression; + prefix: boolean; +}; + +export type UpdateOperator = "++" | "--"; + +// Binary operations + +export type BinaryExpression = NodeBase & { + type: "BinaryExpression"; + operator: BinaryOperator; + left: Expression; + right: Expression; +}; + +export type BinaryOperator = + | "==" | "!=" | "===" | "!==" + | "<" | "<=" | ">" | ">=" + | "<<" | ">>" | ">>>" + | "+" | "-" | "*" | "/" | "%" + | "|" | "^" | "&" | "in" + | "instanceof"; + +export type AssignmentExpression = NodeBase & { + type: "AssignmentExpression"; + operator: AssignmentOperator; + left: Pattern | Expression; + right: Expression; +}; + +export type AssignmentOperator = + | "=" | "+=" | "-=" | "*=" | "/=" | "%=" + | "<<=" | ">>=" | ">>>=" + | "|=" | "^=" | "&="; + +export type LogicalExpression = NodeBase & { + type: "LogicalExpression"; + operator: LogicalOperator; + left: Expression; + right: Expression; +}; + +export type LogicalOperator = "||" | "&&"; + +export type SpreadElement = NodeBase & { + type: "SpreadElement"; + argument: Expression; +}; + +export type MemberExpression = NodeBase & { + type: "MemberExpression"; + object: Expression | Super; + property: Expression; + computed: boolean; +} + +export type BindExpression = NodeBase & { + type: "BindExpression"; + object: $ReadOnlyArray; + callee: $ReadOnlyArray; +}; + +export type ConditionalExpression = NodeBase & { + type: "ConditionalExpression"; + test: Expression; + alternate: Expression; + consequent: Expression; +}; + +export type CallOrNewBase = NodeBase & { + callee: Expression | Super | Import; + arguments: Array; // TODO: $ReadOnlyArray +}; + +export type CallExpression = CallOrNewBase & { + type: "CallExpression"; +}; + +export type NewExpression = CallOrNewBase & { + type: "NewExpression"; +}; + +export type SequenceExpression = NodeBase & { + type: "SequenceExpression"; + expressions: $ReadOnlyArray; +}; + +// Template Literals + +export type TemplateLiteral = NodeBase & { + type: "TemplateLiteral"; + quasis: $ReadOnlyArray; + expressions: $ReadOnlyArray; +}; + +export type TaggedTmplateExpression = NodeBase & { + type: "TaggedTemplateExpression"; + tag: Expression; + quasi: TemplateLiteral; +}; + +export type TemplateElement = NodeBase & { + type: "TemplateElement"; + tail: boolean; + value: { + cooked: string; + raw: string; + } +}; + +// Patterns + +export type PatternBase = HasDecorators & { + // Flow only: + typeAnnotation?: ?FlowTypeAnnotation; +}; + +export type AssignmentProperty = ObjectProperty & { + value: Pattern; +}; + +export type ObjectPattern = PatternBase & { + type: "ObjectPattern"; + properties: $ReadOnlyArray; +}; + +export type ArrayPattern = PatternBase & { + type: "ArrayPattern"; + elements: $ReadOnlyArray; +}; + +export type RestElement = PatternBase & { + type: "RestElement"; + argument: Pattern; +}; + +export type AssignmentPattern = PatternBase & { + type: "AssignmentPattern"; + left: Pattern; + right: Expression; +}; + +// Classes + +export type Class = ClassDeclaration | ClassExpression; + +export type ClassBase = HasDecorators & { + id: ?Identifier; + superClass: ?Expression; + body: ClassBody; + decorators: $ReadOnlyArray; + + typeParameters?: ?FlowTypeParameterDeclaration; // TODO: Not in spec + superTypeParameters?: ?FlowTypeParameterInstantiation; // TODO: Not in spec + implements?: $ReadOnlyArray; +}; + +export type ClassBody = NodeBase & { + type: "ClassBody"; + body: Array; // TODO: $ReadOnlyArray +}; + +export type ClassMemberBase = NodeBase & HasDecorators & { + static: boolean; + computed: boolean; + // TypeScript only: + access?: ?Accessibility; + abstract?: ?true; + optional?: ?true; +} + +export type Accessibility = "public" | "protected" | "private"; + +export type ClassMember = ClassMethod | ClassProperty; + +export type MethodLike = ObjectMethod | FunctionExpression | ClassMethod; + +export type MethodBase = FunctionBase & { + +kind?: MethodKind; +}; + +export type MethodKind = "constructor" | "method" | "get" | "set"; + +export type ClassMethod = MethodBase & ClassMemberBase & { + type: "ClassMethod"; + key: Expression; + kind: MethodKind; + static: boolean; + decorators: $ReadOnlyArray; + + variance?: ?FlowVariance; // TODO: Not in spec +}; + +export type ClassProperty = ClassMemberBase & { + type: "ClassProperty"; + key: Identifier; + value: ?Expression; // TODO: Not in spec that this is nullable. + + typeAnnotation?: ?FlowTypeAnnotation; // TODO: Not in spec + variance?: ?FlowVariance; // TODO: Not in spec + + // TypeScript only: (TODO: Not in spec) + readonly?: true; +}; + +export type ClassDeclaration = ClassBase & DeclarationBase & HasDecorators & { + type: "ClassDeclaration"; + id: Identifier; + // TypeScript only + abstract?: ?true; +}; + +export type ClassExpression = ClassBase & { type: "ClassExpression" }; + +export type MetaProperty = NodeBase & { + type: "MetaProperty"; + meta: Identifier; + property: Identifier; +}; + +// Modules + +export type ModuleDeclaration = AnyImport | AnyExport; + +export type AnyImport = ImportDeclaration; + +export type AnyExport = + | ExportNamedDeclaration + | ExportDefaultDeclaration + | ExportAllDeclaration; + +export type ModuleSpecifier = NodeBase & { + local: Identifier; +}; + +// Imports + +export type ImportDeclaration = NodeBase & { + type: "ImportDeclaration"; + // TODO: $ReadOnlyArray + specifiers: Array; + source: Literal; + + importKind?: "type" | "typeof" | "value"; // TODO: Not in spec +}; + +export type ImportSpecifier = ModuleSpecifier & { + type: "ImportSpecifier"; + imported: Identifier; +}; + +export type ImportDefaultSpecifier = ModuleSpecifier & { + type: "ImportDefaultSpecifier" +}; + +export type ImportNamespaceSpecifier = ModuleSpecifier & { + type: "ImportNamespaceSpecifier" +}; + +// Exports + +export type ExportNamedDeclaration = NodeBase & { + type: "ExportNamedDeclaration"; + declaration: ?Declaration; + specifiers: Array; // TODO: $ReadOnlyArray + source: ?Literal; + + exportKind?: "type" | "value"; // TODO: Not in spec +}; + +export type ExportSpecifier = NodeBase & { + type: "ExportSpecifier"; + exported: Identifier; +}; + +export type ExportDefaultDeclaration = NodeBase & { + type: "ExportDefaultDeclaration"; + declaration: Declaration | Expression; +}; + +export type ExportAllDeclaration = NodeBase & { + type: "ExportAllDeclaration"; + source: Literal; +}; + +// JSX (TODO: Not in spec) + +export type JSXIdentifier = Node; +export type JSXNamespacedName = Node; +export type JSXMemberExpression = Node; +export type JSXEmptyExpression = Node; +export type JSXSpreadChild = Node; +export type JSXExpressionContainer = Node; +export type JSXAttribute = Node; +export type JSXOpeningElement = Node; +export type JSXClosingElement = Node; +export type JSXElement = Node; + +// Flow (TODO: Not in spec) + +export type FlowType = Node; +export type FlowPredicate = Node; +export type FlowDeclare = Node; +export type FlowDeclareClass = Node; +export type FlowDeclareFunction = Node; +export type FlowDeclareVariable = Node; +export type FlowDeclareModule = Node; +export type FlowDeclareModuleExports = Node; +export type FlowDeclareTypeAlias = Node; +export type FlowDeclareInterface = Node; +export type FlowInterface = Node; +export type FlowInterfaceExtends = Node; +export type FlowTypeAlias = Node; +export type FlowTypeParameter = Node; +export type FlowTypeParameterDeclaration = Node; +export type FlowTypeParameterInstantiation = Node; +export type FlowObjectTypeIndexer = Node; +export type FlowFunctionTypeAnnotation = Node; +export type FlowObjectTypeProperty = Node; +export type FlowObjectTypeCallProperty = Node; +export type FlowObjectTypeAnnotation = Node; +export type FlowQualifiedTypeIdentifier = Node; +export type FlowGenericTypeAnnotation = Node; +export type FlowTypeofTypeAnnotation = Node; +export type FlowTupleTypeAnnotation = Node; +export type FlowFunctionTypeParam = Node; +export type FlowTypeAnnotation = Node; +export type FlowVariance = Node; +export type FlowClassImplements = Node; From 2c1193b7daa0d342934404248ba26d6557808453 Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 23 Apr 2017 15:34:35 -0700 Subject: [PATCH 092/105] Move plugin helpers out of Parser.prototype and into the plugin itself (#482) --- src/plugins/estree.js | 70 +- src/plugins/flow.js | 1529 +++++++++++++++++++------------------- src/plugins/jsx/index.js | 595 +++++++-------- 3 files changed, 1099 insertions(+), 1095 deletions(-) diff --git a/src/plugins/estree.js b/src/plugins/estree.js index 585cd7dc2b..3d9f9477a7 100644 --- a/src/plugins/estree.js +++ b/src/plugins/estree.js @@ -1,49 +1,51 @@ import { types as tt } from "../tokenizer/types"; -import Parser from "../parser"; -const pp = Parser.prototype; +function isSimpleProperty(node) { + return node && + node.type === "Property" && + node.kind === "init" && + node.method === false; +} -pp.estreeParseRegExpLiteral = function ({ pattern, flags }) { - let regex = null; - try { - regex = new RegExp(pattern, flags); - } catch (e) { - // In environments that don't support these flags value will - // be null as the regex can't be represented natively. - } - const node = this.estreeParseLiteral(regex); - node.regex = { pattern, flags }; +export default (superClass) => class extends superClass { + estreeParseRegExpLiteral({ pattern, flags }) { + let regex = null; + try { + regex = new RegExp(pattern, flags); + } catch (e) { + // In environments that don't support these flags value will + // be null as the regex can't be represented natively. + } + const node = this.estreeParseLiteral(regex); + node.regex = { pattern, flags }; - return node; -}; + return node; + } -pp.estreeParseLiteral = function (value) { - return this.parseLiteral(value, "Literal"); -}; + estreeParseLiteral(value) { + return this.parseLiteral(value, "Literal"); + } -pp.directiveToStmt = function (directive) { - const directiveLiteral = directive.value; + directiveToStmt(directive) { + const directiveLiteral = directive.value; - const stmt = this.startNodeAt(directive.start, directive.loc.start); - const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start); + const stmt = this.startNodeAt(directive.start, directive.loc.start); + const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start); - expression.value = directiveLiteral.value; - expression.raw = directiveLiteral.extra.raw; + expression.value = directiveLiteral.value; + expression.raw = directiveLiteral.extra.raw; - stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end); - stmt.directive = directiveLiteral.extra.raw.slice(1, -1); + stmt.expression = this.finishNodeAt( + expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end); + stmt.directive = directiveLiteral.extra.raw.slice(1, -1); - return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end); -}; + return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end); + } -function isSimpleProperty(node) { - return node && - node.type === "Property" && - node.kind === "init" && - node.method === false; -} + // ================================== + // Overrides + // ================================== -export default (superClass) => class extends superClass { checkDeclaration(node) { if (isSimpleProperty(node)) { this.checkDeclaration(node.value); diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 3d55c4e7a3..0dcf624fe9 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -2,7 +2,6 @@ import { types as tt } from "../tokenizer/types"; import { types as ct } from "../tokenizer/context"; -import Parser from "../parser"; const primitiveTypes = [ "any", @@ -16,980 +15,982 @@ const primitiveTypes = [ "null" ]; -const pp = Parser.prototype; - -pp.flowParseTypeInitialiser = function (tok) { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(tok || tt.colon); +function isEsModuleType(bodyElement) { + return bodyElement.type === "DeclareExportAllDeclaration" || + ( + bodyElement.type === "DeclareExportDeclaration" && + ( + !bodyElement.declaration || + (bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration") + ) + ); +} - const type = this.flowParseType(); - this.state.inType = oldInType; - return type; +const exportSuggestions = { + const: "declare export var", + let: "declare export var", + type: "export type", + interface: "export interface", }; -pp.flowParsePredicate = function() { - const node = this.startNode(); - const moduloLoc = this.state.startLoc; - const moduloPos = this.state.start; - this.expect(tt.modulo); - const checksLoc = this.state.startLoc; - this.expectContextual("checks"); - // Force '%' and 'checks' to be adjacent - if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) { - this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here."); - } - if (this.eat(tt.parenL)) { - node.value = this.parseExpression(); - this.expect(tt.parenR); - return this.finishNode(node, "DeclaredPredicate"); - } else { - return this.finishNode(node, "InferredPredicate"); - } -}; +export default (superClass) => class extends superClass { + flowParseTypeInitialiser(tok) { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(tok || tt.colon); -pp.flowParseTypeAndPredicateInitialiser = function () { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(tt.colon); - let type = null; - let predicate = null; - if (this.match(tt.modulo)) { - this.state.inType = oldInType; - predicate = this.flowParsePredicate(); - } else { - type = this.flowParseType(); + const type = this.flowParseType(); this.state.inType = oldInType; + return type; + } + + flowParsePredicate() { + const node = this.startNode(); + const moduloLoc = this.state.startLoc; + const moduloPos = this.state.start; + this.expect(tt.modulo); + const checksLoc = this.state.startLoc; + this.expectContextual("checks"); + // Force '%' and 'checks' to be adjacent + if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) { + this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here."); + } + if (this.eat(tt.parenL)) { + node.value = this.parseExpression(); + this.expect(tt.parenR); + return this.finishNode(node, "DeclaredPredicate"); + } else { + return this.finishNode(node, "InferredPredicate"); + } + } + + flowParseTypeAndPredicateInitialiser() { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(tt.colon); + let type = null; + let predicate = null; if (this.match(tt.modulo)) { + this.state.inType = oldInType; predicate = this.flowParsePredicate(); + } else { + type = this.flowParseType(); + this.state.inType = oldInType; + if (this.match(tt.modulo)) { + predicate = this.flowParsePredicate(); + } } + return [type, predicate]; } - return [type, predicate]; -}; - -pp.flowParseDeclareClass = function (node) { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareClass"); -}; - -pp.flowParseDeclareFunction = function (node) { - this.next(); - - const id = node.id = this.parseIdentifier(); - const typeNode = this.startNode(); - const typeContainer = this.startNode(); - - if (this.isRelational("<")) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; + flowParseDeclareClass(node) { + this.next(); + this.flowParseInterfaceish(node); + return this.finishNode(node, "DeclareClass"); } - this.expect(tt.parenL); - const tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - this.expect(tt.parenR); - - [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); + flowParseDeclareFunction(node) { + this.next(); - id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); + const id = node.id = this.parseIdentifier(); - this.finishNode(id, id.type); + const typeNode = this.startNode(); + const typeContainer = this.startNode(); - this.semicolon(); + if (this.isRelational("<")) { + typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + typeNode.typeParameters = null; + } - return this.finishNode(node, "DeclareFunction"); -}; + this.expect(tt.parenL); + const tmp = this.flowParseFunctionTypeParams(); + typeNode.params = tmp.params; + typeNode.rest = tmp.rest; + this.expect(tt.parenR); -pp.flowParseDeclare = function (node, insideModule) { - if (this.match(tt._class)) { - return this.flowParseDeclareClass(node); - } else if (this.match(tt._function)) { - return this.flowParseDeclareFunction(node); - } else if (this.match(tt._var)) { - return this.flowParseDeclareVariable(node); - } else if (this.isContextual("module")) { - if (this.lookahead().type === tt.dot) { - return this.flowParseDeclareModuleExports(node); - } else { - if (insideModule) this.unexpected(null, "`declare module` cannot be used inside another `declare module`"); - return this.flowParseDeclareModule(node); - } - } else if (this.isContextual("type")) { - return this.flowParseDeclareTypeAlias(node); - } else if (this.isContextual("interface")) { - return this.flowParseDeclareInterface(node); - } else if (this.match(tt._export)) { - return this.flowParseDeclareExportDeclaration(node, insideModule); - } else { - this.unexpected(); - } -}; + [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); -pp.flowParseDeclareVariable = function (node) { - this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier(); - this.semicolon(); - return this.finishNode(node, "DeclareVariable"); -}; + id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); -function isEsModuleType(bodyElement) { - return bodyElement.type === "DeclareExportAllDeclaration" || - ( - bodyElement.type === "DeclareExportDeclaration" && - ( - !bodyElement.declaration || - (bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration") - ) - ); -} + this.finishNode(id, id.type); -pp.flowParseDeclareModule = function (node) { - this.next(); + this.semicolon(); - if (this.match(tt.string)) { - node.id = this.parseExprAtom(); - } else { - node.id = this.parseIdentifier(); + return this.finishNode(node, "DeclareFunction"); } - const bodyNode = node.body = this.startNode(); - const body = bodyNode.body = []; - this.expect(tt.braceL); - while (!this.match(tt.braceR)) { - let bodyNode = this.startNode(); - - if (this.match(tt._import)) { - const lookahead = this.lookahead(); - if (lookahead.value !== "type" && lookahead.value !== "typeof") { - this.unexpected(null, "Imports within a `declare module` body must always be `import type` or `import typeof`"); + flowParseDeclare(node, insideModule) { + if (this.match(tt._class)) { + return this.flowParseDeclareClass(node); + } else if (this.match(tt._function)) { + return this.flowParseDeclareFunction(node); + } else if (this.match(tt._var)) { + return this.flowParseDeclareVariable(node); + } else if (this.isContextual("module")) { + if (this.lookahead().type === tt.dot) { + return this.flowParseDeclareModuleExports(node); + } else { + if (insideModule) this.unexpected(null, "`declare module` cannot be used inside another `declare module`"); + return this.flowParseDeclareModule(node); } - - this.parseImport(bodyNode); + } else if (this.isContextual("type")) { + return this.flowParseDeclareTypeAlias(node); + } else if (this.isContextual("interface")) { + return this.flowParseDeclareInterface(node); + } else if (this.match(tt._export)) { + return this.flowParseDeclareExportDeclaration(node, insideModule); } else { - this.expectContextual("declare", "Only declares and type imports are allowed inside declare module"); - - bodyNode = this.flowParseDeclare(bodyNode, true); + this.unexpected(); } + } - body.push(bodyNode); + flowParseDeclareVariable(node) { + this.next(); + node.id = this.flowParseTypeAnnotatableIdentifier(); + this.semicolon(); + return this.finishNode(node, "DeclareVariable"); } - this.expect(tt.braceR); - this.finishNode(bodyNode, "BlockStatement"); + flowParseDeclareModule(node) { + this.next(); - let kind = null; - let hasModuleExport = false; - const errorMessage = "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module"; - body.forEach((bodyElement) => { - if (isEsModuleType(bodyElement)) { - if (kind === "CommonJS") this.unexpected(bodyElement.start, errorMessage); - kind = "ES"; - } else if (bodyElement.type === "DeclareModuleExports") { - if (hasModuleExport) this.unexpected(bodyElement.start, "Duplicate `declare module.exports` statement"); - if (kind === "ES") this.unexpected(bodyElement.start, errorMessage); - kind = "CommonJS"; - hasModuleExport = true; + if (this.match(tt.string)) { + node.id = this.parseExprAtom(); + } else { + node.id = this.parseIdentifier(); } - }); - node.kind = kind || "CommonJS"; - return this.finishNode(node, "DeclareModule"); -}; + const bodyNode = node.body = this.startNode(); + const body = bodyNode.body = []; + this.expect(tt.braceL); + while (!this.match(tt.braceR)) { + let bodyNode = this.startNode(); -const exportSuggestions = { - const: "declare export var", - let: "declare export var", - type: "export type", - interface: "export interface", -}; + if (this.match(tt._import)) { + const lookahead = this.lookahead(); + if (lookahead.value !== "type" && lookahead.value !== "typeof") { + this.unexpected(null, "Imports within a `declare module` body must always be `import type` or `import typeof`"); + } -pp.flowParseDeclareExportDeclaration = function (node, insideModule) { - this.expect(tt._export); + this.parseImport(bodyNode); + } else { + this.expectContextual("declare", "Only declares and type imports are allowed inside declare module"); - if (this.eat(tt._default)) { - if (this.match(tt._function) || this.match(tt._class)) { - // declare export default class ... - // declare export default function ... - node.declaration = this.flowParseDeclare(this.startNode()); - } else { - // declare export default [type]; - node.declaration = this.flowParseType(); - this.semicolon(); - } - node.default = true; + bodyNode = this.flowParseDeclare(bodyNode, true); + } - return this.finishNode(node, "DeclareExportDeclaration"); - } else { - if ( - this.match(tt._const) || this.match(tt._let) || - ( - (this.isContextual("type") || this.isContextual("interface")) && - !insideModule - ) - ) { - const label = this.state.value; - const suggestion = exportSuggestions[label]; - this.unexpected(this.state.start, `\`declare export ${label}\` is not supported. Use \`${suggestion}\` instead`); + body.push(bodyNode); } + this.expect(tt.braceR); - if ( - this.match(tt._var) || // declare export var ... - this.match(tt._function) || // declare export function ... - this.match(tt._class) // declare export class ... - ) { - node.declaration = this.flowParseDeclare(this.startNode()); - node.default = false; + this.finishNode(bodyNode, "BlockStatement"); - return this.finishNode(node, "DeclareExportDeclaration"); - } else if ( - this.match(tt.star) || // declare export * from '' - this.match(tt.braceL) || // declare export {} ... - this.isContextual("interface") || // declare export interface ... - this.isContextual("type") // declare export type ... - ) { - node = this.parseExport(node); - if (node.type === "ExportNamedDeclaration") { - // flow does not support the ExportNamedDeclaration - node.type = "ExportDeclaration"; - node.default = false; - delete node.exportKind; + let kind = null; + let hasModuleExport = false; + const errorMessage = "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module"; + body.forEach((bodyElement) => { + if (isEsModuleType(bodyElement)) { + if (kind === "CommonJS") this.unexpected(bodyElement.start, errorMessage); + kind = "ES"; + } else if (bodyElement.type === "DeclareModuleExports") { + if (hasModuleExport) this.unexpected(bodyElement.start, "Duplicate `declare module.exports` statement"); + if (kind === "ES") this.unexpected(bodyElement.start, errorMessage); + kind = "CommonJS"; + hasModuleExport = true; } + }); - node.type = "Declare" + node.type; - - return node; - } + node.kind = kind || "CommonJS"; + return this.finishNode(node, "DeclareModule"); } - this.unexpected(); -}; + flowParseDeclareExportDeclaration(node, insideModule) { + this.expect(tt._export); -pp.flowParseDeclareModuleExports = function (node) { - this.expectContextual("module"); - this.expect(tt.dot); - this.expectContextual("exports"); - node.typeAnnotation = this.flowParseTypeAnnotation(); - this.semicolon(); + if (this.eat(tt._default)) { + if (this.match(tt._function) || this.match(tt._class)) { + // declare export default class ... + // declare export default function ... + node.declaration = this.flowParseDeclare(this.startNode()); + } else { + // declare export default [type]; + node.declaration = this.flowParseType(); + this.semicolon(); + } + node.default = true; - return this.finishNode(node, "DeclareModuleExports"); -}; + return this.finishNode(node, "DeclareExportDeclaration"); + } else { + if ( + this.match(tt._const) || this.match(tt._let) || + ( + (this.isContextual("type") || this.isContextual("interface")) && + !insideModule + ) + ) { + const label = this.state.value; + const suggestion = exportSuggestions[label]; + this.unexpected(this.state.start, `\`declare export ${label}\` is not supported. Use \`${suggestion}\` instead`); + } -pp.flowParseDeclareTypeAlias = function (node) { - this.next(); - this.flowParseTypeAlias(node); - return this.finishNode(node, "DeclareTypeAlias"); -}; + if ( + this.match(tt._var) || // declare export var ... + this.match(tt._function) || // declare export function ... + this.match(tt._class) // declare export class ... + ) { + node.declaration = this.flowParseDeclare(this.startNode()); + node.default = false; -pp.flowParseDeclareInterface = function (node) { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareInterface"); -}; + return this.finishNode(node, "DeclareExportDeclaration"); + } else if ( + this.match(tt.star) || // declare export * from '' + this.match(tt.braceL) || // declare export {} ... + this.isContextual("interface") || // declare export interface ... + this.isContextual("type") // declare export type ... + ) { + node = this.parseExport(node); + if (node.type === "ExportNamedDeclaration") { + // flow does not support the ExportNamedDeclaration + node.type = "ExportDeclaration"; + node.default = false; + delete node.exportKind; + } -// Interfaces + node.type = "Declare" + node.type; -pp.flowParseInterfaceish = function (node) { - node.id = this.parseIdentifier(); + return node; + } + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; + this.unexpected(); } - node.extends = []; - node.mixins = []; + flowParseDeclareModuleExports(node) { + this.expectContextual("module"); + this.expect(tt.dot); + this.expectContextual("exports"); + node.typeAnnotation = this.flowParseTypeAnnotation(); + this.semicolon(); - if (this.eat(tt._extends)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (this.eat(tt.comma)); + return this.finishNode(node, "DeclareModuleExports"); } - if (this.isContextual("mixins")) { + flowParseDeclareTypeAlias(node) { this.next(); - do { - node.mixins.push(this.flowParseInterfaceExtends()); - } while (this.eat(tt.comma)); + this.flowParseTypeAlias(node); + return this.finishNode(node, "DeclareTypeAlias"); } - node.body = this.flowParseObjectType(true, false, false); -}; + flowParseDeclareInterface(node) { + this.next(); + this.flowParseInterfaceish(node); + return this.finishNode(node, "DeclareInterface"); + } -pp.flowParseInterfaceExtends = function () { - const node = this.startNode(); + // Interfaces - node.id = this.flowParseQualifiedTypeIdentifier(); - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } + flowParseInterfaceish(node) { + node.id = this.parseIdentifier(); - return this.finishNode(node, "InterfaceExtends"); -}; + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } -pp.flowParseInterface = function (node) { - this.flowParseInterfaceish(node); - return this.finishNode(node, "InterfaceDeclaration"); -}; + node.extends = []; + node.mixins = []; + + if (this.eat(tt._extends)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (this.eat(tt.comma)); + } + + if (this.isContextual("mixins")) { + this.next(); + do { + node.mixins.push(this.flowParseInterfaceExtends()); + } while (this.eat(tt.comma)); + } -pp.flowParseRestrictedIdentifier = function(liberal) { - if (primitiveTypes.indexOf(this.state.value) > -1) { - this.raise(this.state.start, `Cannot overwrite primitive type ${this.state.value}`); + node.body = this.flowParseObjectType(true, false, false); } - return this.parseIdentifier(liberal); -}; + flowParseInterfaceExtends() { + const node = this.startNode(); -// Type aliases + node.id = this.flowParseQualifiedTypeIdentifier(); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } -pp.flowParseTypeAlias = function (node) { - node.id = this.flowParseRestrictedIdentifier(); + return this.finishNode(node, "InterfaceExtends"); + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; + flowParseInterface(node) { + this.flowParseInterfaceish(node); + return this.finishNode(node, "InterfaceDeclaration"); } - node.right = this.flowParseTypeInitialiser(tt.eq); - this.semicolon(); + flowParseRestrictedIdentifier(liberal) { + if (primitiveTypes.indexOf(this.state.value) > -1) { + this.raise(this.state.start, `Cannot overwrite primitive type ${this.state.value}`); + } - return this.finishNode(node, "TypeAlias"); -}; + return this.parseIdentifier(liberal); + } -// Type annotations + // Type aliases -pp.flowParseTypeParameter = function () { - const node = this.startNode(); + flowParseTypeAlias(node) { + node.id = this.flowParseRestrictedIdentifier(); - const variance = this.flowParseVariance(); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } - const ident = this.flowParseTypeAnnotatableIdentifier(); - node.name = ident.name; - node.variance = variance; - node.bound = ident.typeAnnotation; + node.right = this.flowParseTypeInitialiser(tt.eq); + this.semicolon(); - if (this.match(tt.eq)) { - this.eat(tt.eq); - node.default = this.flowParseType(); + return this.finishNode(node, "TypeAlias"); } - return this.finishNode(node, "TypeParameter"); -}; + // Type annotations -pp.flowParseTypeParameterDeclaration = function () { - const oldInType = this.state.inType; - const node = this.startNode(); - node.params = []; + flowParseTypeParameter() { + const node = this.startNode(); - this.state.inType = true; + const variance = this.flowParseVariance(); - // istanbul ignore else: this condition is already checked at all call sites - if (this.isRelational("<") || this.match(tt.jsxTagStart)) { - this.next(); - } else { - this.unexpected(); - } + const ident = this.flowParseTypeAnnotatableIdentifier(); + node.name = ident.name; + node.variance = variance; + node.bound = ident.typeAnnotation; - do { - node.params.push(this.flowParseTypeParameter()); - if (!this.isRelational(">")) { - this.expect(tt.comma); + if (this.match(tt.eq)) { + this.eat(tt.eq); + node.default = this.flowParseType(); } - } while (!this.isRelational(">")); - this.expectRelational(">"); - this.state.inType = oldInType; - - return this.finishNode(node, "TypeParameterDeclaration"); -}; + return this.finishNode(node, "TypeParameter"); + } -pp.flowParseTypeParameterInstantiation = function () { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; + flowParseTypeParameterDeclaration() { + const oldInType = this.state.inType; + const node = this.startNode(); + node.params = []; - this.state.inType = true; + this.state.inType = true; - this.expectRelational("<"); - while (!this.isRelational(">")) { - node.params.push(this.flowParseType()); - if (!this.isRelational(">")) { - this.expect(tt.comma); + // istanbul ignore else: this condition is already checked at all call sites + if (this.isRelational("<") || this.match(tt.jsxTagStart)) { + this.next(); + } else { + this.unexpected(); } - } - this.expectRelational(">"); - this.state.inType = oldInType; + do { + node.params.push(this.flowParseTypeParameter()); + if (!this.isRelational(">")) { + this.expect(tt.comma); + } + } while (!this.isRelational(">")); + this.expectRelational(">"); - return this.finishNode(node, "TypeParameterInstantiation"); -}; + this.state.inType = oldInType; -pp.flowParseObjectPropertyKey = function () { - return (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); -}; + return this.finishNode(node, "TypeParameterDeclaration"); + } -pp.flowParseObjectTypeIndexer = function (node, isStatic, variance) { - node.static = isStatic; + flowParseTypeParameterInstantiation() { + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; - this.expect(tt.bracketL); - if (this.lookahead().type === tt.colon) { - node.id = this.flowParseObjectPropertyKey(); - node.key = this.flowParseTypeInitialiser(); - } else { - node.id = null; - node.key = this.flowParseType(); - } - this.expect(tt.bracketR); - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; + this.state.inType = true; - return this.finishNode(node, "ObjectTypeIndexer"); -}; + this.expectRelational("<"); + while (!this.isRelational(">")) { + node.params.push(this.flowParseType()); + if (!this.isRelational(">")) { + this.expect(tt.comma); + } + } + this.expectRelational(">"); + + this.state.inType = oldInType; -pp.flowParseObjectTypeMethodish = function (node) { - node.params = []; - node.rest = null; - node.typeParameters = null; + return this.finishNode(node, "TypeParameterInstantiation"); + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); + flowParseObjectPropertyKey() { + return (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); } - this.expect(tt.parenL); - while (this.match(tt.name)) { - node.params.push(this.flowParseFunctionTypeParam()); - if (!this.match(tt.parenR)) { - this.expect(tt.comma); + flowParseObjectTypeIndexer(node, isStatic, variance) { + node.static = isStatic; + + this.expect(tt.bracketL); + if (this.lookahead().type === tt.colon) { + node.id = this.flowParseObjectPropertyKey(); + node.key = this.flowParseTypeInitialiser(); + } else { + node.id = null; + node.key = this.flowParseType(); } - } + this.expect(tt.bracketR); + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; - if (this.eat(tt.ellipsis)) { - node.rest = this.flowParseFunctionTypeParam(); + return this.finishNode(node, "ObjectTypeIndexer"); } - this.expect(tt.parenR); - node.returnType = this.flowParseTypeInitialiser(); - return this.finishNode(node, "FunctionTypeAnnotation"); -}; + flowParseObjectTypeMethodish(node) { + node.params = []; + node.rest = null; + node.typeParameters = null; -pp.flowParseObjectTypeCallProperty = function (node, isStatic) { - const valueNode = this.startNode(); - node.static = isStatic; - node.value = this.flowParseObjectTypeMethodish(valueNode); - return this.finishNode(node, "ObjectTypeCallProperty"); -}; + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } -pp.flowParseObjectType = function (allowStatic, allowExact, allowSpread) { - const oldInType = this.state.inType; - this.state.inType = true; + this.expect(tt.parenL); + while (this.match(tt.name)) { + node.params.push(this.flowParseFunctionTypeParam()); + if (!this.match(tt.parenR)) { + this.expect(tt.comma); + } + } - const nodeStart = this.startNode(); + if (this.eat(tt.ellipsis)) { + node.rest = this.flowParseFunctionTypeParam(); + } + this.expect(tt.parenR); + node.returnType = this.flowParseTypeInitialiser(); - nodeStart.callProperties = []; - nodeStart.properties = []; - nodeStart.indexers = []; + return this.finishNode(node, "FunctionTypeAnnotation"); + } - let endDelim; - let exact; - if (allowExact && this.match(tt.braceBarL)) { - this.expect(tt.braceBarL); - endDelim = tt.braceBarR; - exact = true; - } else { - this.expect(tt.braceL); - endDelim = tt.braceR; - exact = false; + flowParseObjectTypeCallProperty(node, isStatic) { + const valueNode = this.startNode(); + node.static = isStatic; + node.value = this.flowParseObjectTypeMethodish(valueNode); + return this.finishNode(node, "ObjectTypeCallProperty"); } - nodeStart.exact = exact; + flowParseObjectType(allowStatic, allowExact, allowSpread) { + const oldInType = this.state.inType; + this.state.inType = true; - while (!this.match(endDelim)) { - let isStatic = false; - const node = this.startNode(); - if (allowStatic && this.isContextual("static") && this.lookahead().type !== tt.colon) { - this.next(); - isStatic = true; - } + const nodeStart = this.startNode(); - const variance = this.flowParseVariance(); + nodeStart.callProperties = []; + nodeStart.properties = []; + nodeStart.indexers = []; - if (this.match(tt.bracketL)) { - nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); - } else if (this.match(tt.parenL) || this.isRelational("<")) { - if (variance) { - this.unexpected(variance.start); - } - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + let endDelim; + let exact; + if (allowExact && this.match(tt.braceBarL)) { + this.expect(tt.braceBarL); + endDelim = tt.braceBarR; + exact = true; } else { - let kind = "init"; + this.expect(tt.braceL); + endDelim = tt.braceR; + exact = false; + } - if (this.isContextual("get") || this.isContextual("set")) { - const lookahead = this.lookahead(); - if ( - lookahead.type === tt.name || - lookahead.type === tt.string || - lookahead.type === tt.num - ) { - kind = this.state.value; - this.next(); - } + nodeStart.exact = exact; + + while (!this.match(endDelim)) { + let isStatic = false; + const node = this.startNode(); + if (allowStatic && this.isContextual("static") && this.lookahead().type !== tt.colon) { + this.next(); + isStatic = true; } - nodeStart.properties.push(this.flowParseObjectTypeProperty(node, isStatic, variance, kind, allowSpread)); - } + const variance = this.flowParseVariance(); - this.flowObjectTypeSemicolon(); - } + if (this.match(tt.bracketL)) { + nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); + } else if (this.match(tt.parenL) || this.isRelational("<")) { + if (variance) { + this.unexpected(variance.start); + } + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + } else { + let kind = "init"; + + if (this.isContextual("get") || this.isContextual("set")) { + const lookahead = this.lookahead(); + if ( + lookahead.type === tt.name || + lookahead.type === tt.string || + lookahead.type === tt.num + ) { + kind = this.state.value; + this.next(); + } + } - this.expect(endDelim); + nodeStart.properties.push(this.flowParseObjectTypeProperty(node, isStatic, variance, kind, allowSpread)); + } - const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); + this.flowObjectTypeSemicolon(); + } - this.state.inType = oldInType; + this.expect(endDelim); - return out; -}; + const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); -pp.flowParseObjectTypeProperty = function (node, isStatic, variance, kind, allowSpread) { - if (this.match(tt.ellipsis)) { - if (!allowSpread) { - this.unexpected( - null, - "Spread operator cannot appear in class or interface definitions" - ); - } - if (variance) { - this.unexpected(variance.start, "Spread properties cannot have variance"); - } - this.expect(tt.ellipsis); - node.argument = this.flowParseType(); + this.state.inType = oldInType; - return this.finishNode(node, "ObjectTypeSpreadProperty"); - } else { - node.key = this.flowParseObjectPropertyKey(); - node.static = isStatic; - node.kind = kind; + return out; + } - let optional = false; - if (this.isRelational("<") || this.match(tt.parenL)) { - // This is a method property + flowParseObjectTypeProperty(node, isStatic, variance, kind, allowSpread) { + if (this.match(tt.ellipsis)) { + if (!allowSpread) { + this.unexpected( + null, + "Spread operator cannot appear in class or interface definitions" + ); + } if (variance) { - this.unexpected(variance.start); + this.unexpected(variance.start, "Spread properties cannot have variance"); } + this.expect(tt.ellipsis); + node.argument = this.flowParseType(); - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - if (kind === "get" || kind === "set") this.flowCheckGetterSetterParamCount(node); + return this.finishNode(node, "ObjectTypeSpreadProperty"); } else { - if (kind !== "init") this.unexpected(); - if (this.eat(tt.question)) { - optional = true; - } - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; + node.key = this.flowParseObjectPropertyKey(); + node.static = isStatic; + node.kind = kind; + + let optional = false; + if (this.isRelational("<") || this.match(tt.parenL)) { + // This is a method property + if (variance) { + this.unexpected(variance.start); + } - } + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); + if (kind === "get" || kind === "set") this.flowCheckGetterSetterParamCount(node); + } else { + if (kind !== "init") this.unexpected(); + if (this.eat(tt.question)) { + optional = true; + } + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; - node.optional = optional; + } - return this.finishNode(node, "ObjectTypeProperty"); + node.optional = optional; + + return this.finishNode(node, "ObjectTypeProperty"); + } } -}; -// This is similar to checkGetterSetterParamCount, but as -// babylon uses non estree properties we cannot reuse it here -pp.flowCheckGetterSetterParamCount = function (property) { - const paramCount = property.kind === "get" ? 0 : 1; - if (property.value.params.length !== paramCount) { - const start = property.start; - if (property.kind === "get") { - this.raise(start, "getter should have no params"); - } else { - this.raise(start, "setter should have exactly one param"); + // This is similar to checkGetterSetterParamCount, but as + // babylon uses non estree properties we cannot reuse it here + flowCheckGetterSetterParamCount(property) { + const paramCount = property.kind === "get" ? 0 : 1; + if (property.value.params.length !== paramCount) { + const start = property.start; + if (property.kind === "get") { + this.raise(start, "getter should have no params"); + } else { + this.raise(start, "setter should have exactly one param"); + } } } -}; -pp.flowObjectTypeSemicolon = function () { - if (!this.eat(tt.semi) && !this.eat(tt.comma) && - !this.match(tt.braceR) && !this.match(tt.braceBarR)) { - this.unexpected(); + flowObjectTypeSemicolon() { + if (!this.eat(tt.semi) && !this.eat(tt.comma) && + !this.match(tt.braceR) && !this.match(tt.braceBarR)) { + this.unexpected(); + } } -}; -pp.flowParseQualifiedTypeIdentifier = function (startPos, startLoc, id) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - let node = id || this.parseIdentifier(); + flowParseQualifiedTypeIdentifier(startPos, startLoc, id) { + startPos = startPos || this.state.start; + startLoc = startLoc || this.state.startLoc; + let node = id || this.parseIdentifier(); - while (this.eat(tt.dot)) { - const node2 = this.startNodeAt(startPos, startLoc); - node2.qualification = node; - node2.id = this.parseIdentifier(); - node = this.finishNode(node2, "QualifiedTypeIdentifier"); + while (this.eat(tt.dot)) { + const node2 = this.startNodeAt(startPos, startLoc); + node2.qualification = node; + node2.id = this.parseIdentifier(); + node = this.finishNode(node2, "QualifiedTypeIdentifier"); + } + + return node; } - return node; -}; + flowParseGenericType(startPos, startLoc, id) { + const node = this.startNodeAt(startPos, startLoc); -pp.flowParseGenericType = function (startPos, startLoc, id) { - const node = this.startNodeAt(startPos, startLoc); + node.typeParameters = null; + node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); - node.typeParameters = null; - node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); + return this.finishNode(node, "GenericTypeAnnotation"); } - return this.finishNode(node, "GenericTypeAnnotation"); -}; - -pp.flowParseTypeofType = function () { - const node = this.startNode(); - this.expect(tt._typeof); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); -}; + flowParseTypeofType() { + const node = this.startNode(); + this.expect(tt._typeof); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); + } -pp.flowParseTupleType = function () { - const node = this.startNode(); - node.types = []; - this.expect(tt.bracketL); - // We allow trailing commas - while (this.state.pos < this.input.length && !this.match(tt.bracketR)) { - node.types.push(this.flowParseType()); - if (this.match(tt.bracketR)) break; - this.expect(tt.comma); - } - this.expect(tt.bracketR); - return this.finishNode(node, "TupleTypeAnnotation"); -}; + flowParseTupleType() { + const node = this.startNode(); + node.types = []; + this.expect(tt.bracketL); + // We allow trailing commas + while (this.state.pos < this.input.length && !this.match(tt.bracketR)) { + node.types.push(this.flowParseType()); + if (this.match(tt.bracketR)) break; + this.expect(tt.comma); + } + this.expect(tt.bracketR); + return this.finishNode(node, "TupleTypeAnnotation"); + } -pp.flowParseFunctionTypeParam = function () { - let name = null; - let optional = false; - let typeAnnotation = null; - const node = this.startNode(); - const lh = this.lookahead(); - if (lh.type === tt.colon || - lh.type === tt.question) { - name = this.parseIdentifier(); - if (this.eat(tt.question)) { - optional = true; + flowParseFunctionTypeParam() { + let name = null; + let optional = false; + let typeAnnotation = null; + const node = this.startNode(); + const lh = this.lookahead(); + if (lh.type === tt.colon || + lh.type === tt.question) { + name = this.parseIdentifier(); + if (this.eat(tt.question)) { + optional = true; + } + typeAnnotation = this.flowParseTypeInitialiser(); + } else { + typeAnnotation = this.flowParseType(); } - typeAnnotation = this.flowParseTypeInitialiser(); - } else { - typeAnnotation = this.flowParseType(); + node.name = name; + node.optional = optional; + node.typeAnnotation = typeAnnotation; + return this.finishNode(node, "FunctionTypeParam"); } - node.name = name; - node.optional = optional; - node.typeAnnotation = typeAnnotation; - return this.finishNode(node, "FunctionTypeParam"); -}; -pp.reinterpretTypeAsFunctionTypeParam = function (type) { - const node = this.startNodeAt(type.start, type.loc); - node.name = null; - node.optional = false; - node.typeAnnotation = type; - return this.finishNode(node, "FunctionTypeParam"); -}; + reinterpretTypeAsFunctionTypeParam(type) { + const node = this.startNodeAt(type.start, type.loc); + node.name = null; + node.optional = false; + node.typeAnnotation = type; + return this.finishNode(node, "FunctionTypeParam"); + } -pp.flowParseFunctionTypeParams = function (params = []) { - const ret = { params, rest: null }; - while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) { - ret.params.push(this.flowParseFunctionTypeParam()); - if (!this.match(tt.parenR)) { - this.expect(tt.comma); + flowParseFunctionTypeParams(params = []) { + const ret = { params, rest: null }; + while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) { + ret.params.push(this.flowParseFunctionTypeParam()); + if (!this.match(tt.parenR)) { + this.expect(tt.comma); + } } + if (this.eat(tt.ellipsis)) { + ret.rest = this.flowParseFunctionTypeParam(); + } + return ret; } - if (this.eat(tt.ellipsis)) { - ret.rest = this.flowParseFunctionTypeParam(); - } - return ret; -}; -pp.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) { - switch (id.name) { - case "any": - return this.finishNode(node, "AnyTypeAnnotation"); + flowIdentToTypeAnnotation(startPos, startLoc, node, id) { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); - case "void": - return this.finishNode(node, "VoidTypeAnnotation"); + case "void": + return this.finishNode(node, "VoidTypeAnnotation"); - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); - case "empty": - return this.finishNode(node, "EmptyTypeAnnotation"); + case "empty": + return this.finishNode(node, "EmptyTypeAnnotation"); - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); - case "string": - return this.finishNode(node, "StringTypeAnnotation"); + case "string": + return this.finishNode(node, "StringTypeAnnotation"); - default: - return this.flowParseGenericType(startPos, startLoc, id); + default: + return this.flowParseGenericType(startPos, startLoc, id); + } } -}; -// The parsing of types roughly parallels the parsing of expressions, and -// primary types are kind of like primary expressions...they're the -// primitives with which other types are constructed. -pp.flowParsePrimaryType = function () { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const node = this.startNode(); - let tmp; - let type; - let isGroupedType = false; - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - - switch (this.state.type) { - case tt.name: - return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); - - case tt.braceL: - return this.flowParseObjectType(false, false, true); - - case tt.braceBarL: - return this.flowParseObjectType(false, true, true); - - case tt.bracketL: - return this.flowParseTupleType(); - - case tt.relational: - if (this.state.value === "<") { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - this.expect(tt.parenL); - tmp = this.flowParseFunctionTypeParams(); - node.params = tmp.params; - node.rest = tmp.rest; - this.expect(tt.parenR); + // The parsing of types roughly parallels the parsing of expressions, and + // primary types are kind of like primary expressions...they're the + // primitives with which other types are constructed. + flowParsePrimaryType() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const node = this.startNode(); + let tmp; + let type; + let isGroupedType = false; + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + + switch (this.state.type) { + case tt.name: + return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); + + case tt.braceL: + return this.flowParseObjectType(false, false, true); + + case tt.braceBarL: + return this.flowParseObjectType(false, true, true); + + case tt.bracketL: + return this.flowParseTupleType(); + + case tt.relational: + if (this.state.value === "<") { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + this.expect(tt.parenL); + tmp = this.flowParseFunctionTypeParams(); + node.params = tmp.params; + node.rest = tmp.rest; + this.expect(tt.parenR); - this.expect(tt.arrow); + this.expect(tt.arrow); - node.returnType = this.flowParseType(); + node.returnType = this.flowParseType(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - break; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + break; - case tt.parenL: - this.next(); + case tt.parenL: + this.next(); - // Check to see if this is actually a grouped type - if (!this.match(tt.parenR) && !this.match(tt.ellipsis)) { - if (this.match(tt.name)) { - const token = this.lookahead().type; - isGroupedType = token !== tt.question && token !== tt.colon; - } else { - isGroupedType = true; + // Check to see if this is actually a grouped type + if (!this.match(tt.parenR) && !this.match(tt.ellipsis)) { + if (this.match(tt.name)) { + const token = this.lookahead().type; + isGroupedType = token !== tt.question && token !== tt.colon; + } else { + isGroupedType = true; + } } - } - if (isGroupedType) { - this.state.noAnonFunctionType = false; - type = this.flowParseType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (isGroupedType) { + this.state.noAnonFunctionType = false; + type = this.flowParseType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + + // A `,` or a `) =>` means this is an anonymous function type + if (this.state.noAnonFunctionType || + !(this.match(tt.comma) || + (this.match(tt.parenR) && this.lookahead().type === tt.arrow))) { + this.expect(tt.parenR); + return type; + } else { + // Eat a comma if there is one + this.eat(tt.comma); + } + } - // A `,` or a `) =>` means this is an anonymous function type - if (this.state.noAnonFunctionType || - !(this.match(tt.comma) || - (this.match(tt.parenR) && this.lookahead().type === tt.arrow))) { - this.expect(tt.parenR); - return type; + if (type) { + tmp = this.flowParseFunctionTypeParams( + [this.reinterpretTypeAsFunctionTypeParam(type)], + ); } else { - // Eat a comma if there is one - this.eat(tt.comma); + tmp = this.flowParseFunctionTypeParams(); } - } - if (type) { - tmp = this.flowParseFunctionTypeParams( - [this.reinterpretTypeAsFunctionTypeParam(type)], - ); - } else { - tmp = this.flowParseFunctionTypeParams(); - } + node.params = tmp.params; + node.rest = tmp.rest; - node.params = tmp.params; - node.rest = tmp.rest; + this.expect(tt.parenR); - this.expect(tt.parenR); + this.expect(tt.arrow); - this.expect(tt.arrow); + node.returnType = this.flowParseType(); - node.returnType = this.flowParseType(); + node.typeParameters = null; - node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); - return this.finishNode(node, "FunctionTypeAnnotation"); + case tt.string: + return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); - case tt.string: - return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); + case tt._true: case tt._false: + node.value = this.match(tt._true); + this.next(); + return this.finishNode(node, "BooleanLiteralTypeAnnotation"); - case tt._true: case tt._false: - node.value = this.match(tt._true); - this.next(); - return this.finishNode(node, "BooleanLiteralTypeAnnotation"); + case tt.plusMin: + if (this.state.value === "-") { + this.next(); + if (!this.match(tt.num)) this.unexpected(null, "Unexpected token, expected number"); - case tt.plusMin: - if (this.state.value === "-") { - this.next(); - if (!this.match(tt.num)) this.unexpected(null, "Unexpected token, expected number"); + return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); + } - return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); - } + this.unexpected(); + case tt.num: + return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); - this.unexpected(); - case tt.num: - return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); + case tt._null: + node.value = this.match(tt._null); + this.next(); + return this.finishNode(node, "NullLiteralTypeAnnotation"); - case tt._null: - node.value = this.match(tt._null); - this.next(); - return this.finishNode(node, "NullLiteralTypeAnnotation"); + case tt._this: + node.value = this.match(tt._this); + this.next(); + return this.finishNode(node, "ThisTypeAnnotation"); - case tt._this: - node.value = this.match(tt._this); - this.next(); - return this.finishNode(node, "ThisTypeAnnotation"); + case tt.star: + this.next(); + return this.finishNode(node, "ExistsTypeAnnotation"); - case tt.star: - this.next(); - return this.finishNode(node, "ExistsTypeAnnotation"); + default: + if (this.state.type.keyword === "typeof") { + return this.flowParseTypeofType(); + } + } - default: - if (this.state.type.keyword === "typeof") { - return this.flowParseTypeofType(); - } + this.unexpected(); } - this.unexpected(); -}; - -pp.flowParsePostfixType = function () { - const startPos = this.state.start, startLoc = this.state.startLoc; - let type = this.flowParsePrimaryType(); - while (!this.canInsertSemicolon() && this.match(tt.bracketL)) { - const node = this.startNodeAt(startPos, startLoc); - node.elementType = type; - this.expect(tt.bracketL); - this.expect(tt.bracketR); - type = this.finishNode(node, "ArrayTypeAnnotation"); + flowParsePostfixType() { + const startPos = this.state.start, startLoc = this.state.startLoc; + let type = this.flowParsePrimaryType(); + while (!this.canInsertSemicolon() && this.match(tt.bracketL)) { + const node = this.startNodeAt(startPos, startLoc); + node.elementType = type; + this.expect(tt.bracketL); + this.expect(tt.bracketR); + type = this.finishNode(node, "ArrayTypeAnnotation"); + } + return type; } - return type; -}; -pp.flowParsePrefixType = function () { - const node = this.startNode(); - if (this.eat(tt.question)) { - node.typeAnnotation = this.flowParsePrefixType(); - return this.finishNode(node, "NullableTypeAnnotation"); - } else { - return this.flowParsePostfixType(); + flowParsePrefixType() { + const node = this.startNode(); + if (this.eat(tt.question)) { + node.typeAnnotation = this.flowParsePrefixType(); + return this.finishNode(node, "NullableTypeAnnotation"); + } else { + return this.flowParsePostfixType(); + } } -}; -pp.flowParseAnonFunctionWithoutParens = function () { - const param = this.flowParsePrefixType(); - if (!this.state.noAnonFunctionType && this.eat(tt.arrow)) { - const node = this.startNodeAt(param.start, param.loc); - node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; - node.rest = null; - node.returnType = this.flowParseType(); - node.typeParameters = null; - return this.finishNode(node, "FunctionTypeAnnotation"); + flowParseAnonFunctionWithoutParens() { + const param = this.flowParsePrefixType(); + if (!this.state.noAnonFunctionType && this.eat(tt.arrow)) { + const node = this.startNodeAt(param.start, param.loc); + node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; + node.rest = null; + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + return param; } - return param; -}; -pp.flowParseIntersectionType = function () { - const node = this.startNode(); - this.eat(tt.bitwiseAND); - const type = this.flowParseAnonFunctionWithoutParens(); - node.types = [type]; - while (this.eat(tt.bitwiseAND)) { - node.types.push(this.flowParseAnonFunctionWithoutParens()); + flowParseIntersectionType() { + const node = this.startNode(); + this.eat(tt.bitwiseAND); + const type = this.flowParseAnonFunctionWithoutParens(); + node.types = [type]; + while (this.eat(tt.bitwiseAND)) { + node.types.push(this.flowParseAnonFunctionWithoutParens()); + } + return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); } - return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); -}; -pp.flowParseUnionType = function () { - const node = this.startNode(); - this.eat(tt.bitwiseOR); - const type = this.flowParseIntersectionType(); - node.types = [type]; - while (this.eat(tt.bitwiseOR)) { - node.types.push(this.flowParseIntersectionType()); + flowParseUnionType() { + const node = this.startNode(); + this.eat(tt.bitwiseOR); + const type = this.flowParseIntersectionType(); + node.types = [type]; + while (this.eat(tt.bitwiseOR)) { + node.types.push(this.flowParseIntersectionType()); + } + return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); } - return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); -}; -pp.flowParseType = function () { - const oldInType = this.state.inType; - this.state.inType = true; - const type = this.flowParseUnionType(); - this.state.inType = oldInType; - return type; -}; + flowParseType() { + const oldInType = this.state.inType; + this.state.inType = true; + const type = this.flowParseUnionType(); + this.state.inType = oldInType; + return type; + } -pp.flowParseTypeAnnotation = function () { - const node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); -}; + flowParseTypeAnnotation() { + const node = this.startNode(); + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "TypeAnnotation"); + } -pp.flowParseTypeAnnotatableIdentifier = function () { - const ident = this.flowParseRestrictedIdentifier(); - if (this.match(tt.colon)) { - ident.typeAnnotation = this.flowParseTypeAnnotation(); - this.finishNode(ident, ident.type); + flowParseTypeAnnotatableIdentifier() { + const ident = this.flowParseRestrictedIdentifier(); + if (this.match(tt.colon)) { + ident.typeAnnotation = this.flowParseTypeAnnotation(); + this.finishNode(ident, ident.type); + } + return ident; } - return ident; -}; -pp.typeCastToParameter = function (node) { - node.expression.typeAnnotation = node.typeAnnotation; + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; - return this.finishNodeAt( - node.expression, - node.expression.type, - node.typeAnnotation.end, - node.typeAnnotation.loc.end - ); -}; + return this.finishNodeAt( + node.expression, + node.expression.type, + node.typeAnnotation.end, + node.typeAnnotation.loc.end + ); + } -pp.flowParseVariance = function() { - let variance = null; - if (this.match(tt.plusMin)) { - variance = this.startNode(); - if (this.state.value === "+") { - variance.kind = "plus"; - } else { - variance.kind = "minus"; + flowParseVariance() { + let variance = null; + if (this.match(tt.plusMin)) { + variance = this.startNode(); + if (this.state.value === "+") { + variance.kind = "plus"; + } else { + variance.kind = "minus"; + } + this.next(); + this.finishNode(variance, "Variance"); } - this.next(); - this.finishNode(variance, "Variance"); + return variance; } - return variance; -}; -export default (superClass) => class extends superClass { + // ================================== + // Overrides + // ================================== + // plain function return types: function name(): string {} parseFunctionBody(node, allowExpression) { if (this.match(tt.colon) && !allowExpression) { diff --git a/src/plugins/jsx/index.js b/src/plugins/jsx/index.js index 7309fa9121..c309d2c965 100644 --- a/src/plugins/jsx/index.js +++ b/src/plugins/jsx/index.js @@ -1,7 +1,6 @@ import XHTMLEntities from "./xhtml"; import { TokenType, types as tt } from "../../tokenizer/types"; import { TokContext, types as tc } from "../../tokenizer/context"; -import Parser from "../../parser"; import { isIdentifierChar, isIdentifierStart } from "../../util/identifier"; import { isNewLine } from "../../util/whitespace"; @@ -33,369 +32,371 @@ tt.jsxTagEnd.updateContext = function(prevType) { } }; -const pp = Parser.prototype; +// Transforms JSX element name to string. -// Reads inline JSX contents token. +function getQualifiedJSXName(object) { + if (object.type === "JSXIdentifier") { + return object.name; + } -pp.jsxReadToken = function() { - let out = ""; - let chunkStart = this.state.pos; - for (;;) { - if (this.state.pos >= this.input.length) { - this.raise(this.state.start, "Unterminated JSX contents"); - } + if (object.type === "JSXNamespacedName") { + return object.namespace.name + ":" + object.name.name; + } - const ch = this.input.charCodeAt(this.state.pos); + if (object.type === "JSXMemberExpression") { + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + } +} - switch (ch) { - case 60: // "<" - case 123: // "{" - if (this.state.pos === this.state.start) { - if (ch === 60 && this.state.exprAllowed) { - ++this.state.pos; - return this.finishToken(tt.jsxTagStart); - } - return this.getTokenFromCode(ch); - } - out += this.input.slice(chunkStart, this.state.pos); - return this.finishToken(tt.jsxText, out); +export default (superClass) => class extends superClass { + // Reads inline JSX contents token. + + jsxReadToken() { + let out = ""; + let chunkStart = this.state.pos; + for (;;) { + if (this.state.pos >= this.input.length) { + this.raise(this.state.start, "Unterminated JSX contents"); + } - case 38: // "&" - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - break; + const ch = this.input.charCodeAt(this.state.pos); + + switch (ch) { + case 60: // "<" + case 123: // "{" + if (this.state.pos === this.state.start) { + if (ch === 60 && this.state.exprAllowed) { + ++this.state.pos; + return this.finishToken(tt.jsxTagStart); + } + return this.getTokenFromCode(ch); + } + out += this.input.slice(chunkStart, this.state.pos); + return this.finishToken(tt.jsxText, out); - default: - if (isNewLine(ch)) { + case 38: // "&" out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(true); + out += this.jsxReadEntity(); chunkStart = this.state.pos; - } else { - ++this.state.pos; - } + break; + + default: + if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(true); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } } } -}; -pp.jsxReadNewLine = function(normalizeCRLF) { - const ch = this.input.charCodeAt(this.state.pos); - let out; - ++this.state.pos; - if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { + jsxReadNewLine(normalizeCRLF) { + const ch = this.input.charCodeAt(this.state.pos); + let out; ++this.state.pos; - out = normalizeCRLF ? "\n" : "\r\n"; - } else { - out = String.fromCharCode(ch); - } - ++this.state.curLine; - this.state.lineStart = this.state.pos; + if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { + ++this.state.pos; + out = normalizeCRLF ? "\n" : "\r\n"; + } else { + out = String.fromCharCode(ch); + } + ++this.state.curLine; + this.state.lineStart = this.state.pos; - return out; -}; + return out; + } -pp.jsxReadString = function(quote) { - let out = ""; - let chunkStart = ++this.state.pos; - for (;;) { - if (this.state.pos >= this.input.length) { - this.raise(this.state.start, "Unterminated string constant"); - } + jsxReadString(quote) { + let out = ""; + let chunkStart = ++this.state.pos; + for (;;) { + if (this.state.pos >= this.input.length) { + this.raise(this.state.start, "Unterminated string constant"); + } - const ch = this.input.charCodeAt(this.state.pos); - if (ch === quote) break; - if (ch === 38) { // "&" - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(false); - chunkStart = this.state.pos; - } else { - ++this.state.pos; + const ch = this.input.charCodeAt(this.state.pos); + if (ch === quote) break; + if (ch === 38) { // "&" + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(false); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } } + out += this.input.slice(chunkStart, this.state.pos++); + return this.finishToken(tt.string, out); } - out += this.input.slice(chunkStart, this.state.pos++); - return this.finishToken(tt.string, out); -}; -pp.jsxReadEntity = function() { - let str = ""; - let count = 0; - let entity; - let ch = this.input[this.state.pos]; - - const startPos = ++this.state.pos; - while (this.state.pos < this.input.length && count++ < 10) { - ch = this.input[this.state.pos++]; - if (ch === ";") { - if (str[0] === "#") { - if (str[1] === "x") { - str = str.substr(2); - if (HEX_NUMBER.test(str)) - entity = String.fromCodePoint(parseInt(str, 16)); + jsxReadEntity() { + let str = ""; + let count = 0; + let entity; + let ch = this.input[this.state.pos]; + + const startPos = ++this.state.pos; + while (this.state.pos < this.input.length && count++ < 10) { + ch = this.input[this.state.pos++]; + if (ch === ";") { + if (str[0] === "#") { + if (str[1] === "x") { + str = str.substr(2); + if (HEX_NUMBER.test(str)) + entity = String.fromCodePoint(parseInt(str, 16)); + } else { + str = str.substr(1); + if (DECIMAL_NUMBER.test(str)) + entity = String.fromCodePoint(parseInt(str, 10)); + } } else { - str = str.substr(1); - if (DECIMAL_NUMBER.test(str)) - entity = String.fromCodePoint(parseInt(str, 10)); + entity = XHTMLEntities[str]; } - } else { - entity = XHTMLEntities[str]; + break; } - break; + str += ch; } - str += ch; - } - if (!entity) { - this.state.pos = startPos; - return "&"; - } - return entity; -}; - - -// Read a JSX identifier (valid tag or attribute name). -// -// Optimized version since JSX identifiers can"t contain -// escape characters and so can be read as single slice. -// Also assumes that first character was already checked -// by isIdentifierStart in readToken. - -pp.jsxReadWord = function() { - let ch; - const start = this.state.pos; - do { - ch = this.input.charCodeAt(++this.state.pos); - } while (isIdentifierChar(ch) || ch === 45); // "-" - return this.finishToken(tt.jsxName, this.input.slice(start, this.state.pos)); -}; - -// Transforms JSX element name to string. - -function getQualifiedJSXName(object) { - if (object.type === "JSXIdentifier") { - return object.name; + if (!entity) { + this.state.pos = startPos; + return "&"; + } + return entity; } - if (object.type === "JSXNamespacedName") { - return object.namespace.name + ":" + object.name.name; - } - if (object.type === "JSXMemberExpression") { - return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + // Read a JSX identifier (valid tag or attribute name). + // + // Optimized version since JSX identifiers can"t contain + // escape characters and so can be read as single slice. + // Also assumes that first character was already checked + // by isIdentifierStart in readToken. + + jsxReadWord() { + let ch; + const start = this.state.pos; + do { + ch = this.input.charCodeAt(++this.state.pos); + } while (isIdentifierChar(ch) || ch === 45); // "-" + return this.finishToken(tt.jsxName, this.input.slice(start, this.state.pos)); } -} -// Parse next token as JSX identifier + // Parse next token as JSX identifier -pp.jsxParseIdentifier = function() { - const node = this.startNode(); - if (this.match(tt.jsxName)) { - node.name = this.state.value; - } else if (this.state.type.keyword) { - node.name = this.state.type.keyword; - } else { - this.unexpected(); + jsxParseIdentifier() { + const node = this.startNode(); + if (this.match(tt.jsxName)) { + node.name = this.state.value; + } else if (this.state.type.keyword) { + node.name = this.state.type.keyword; + } else { + this.unexpected(); + } + this.next(); + return this.finishNode(node, "JSXIdentifier"); } - this.next(); - return this.finishNode(node, "JSXIdentifier"); -}; -// Parse namespaced identifier. + // Parse namespaced identifier. -pp.jsxParseNamespacedName = function() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const name = this.jsxParseIdentifier(); - if (!this.eat(tt.colon)) return name; + jsxParseNamespacedName() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const name = this.jsxParseIdentifier(); + if (!this.eat(tt.colon)) return name; - const node = this.startNodeAt(startPos, startLoc); - node.namespace = name; - node.name = this.jsxParseIdentifier(); - return this.finishNode(node, "JSXNamespacedName"); -}; + const node = this.startNodeAt(startPos, startLoc); + node.namespace = name; + node.name = this.jsxParseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); + } -// Parses element name in any form - namespaced, member -// or single identifier. - -pp.jsxParseElementName = function() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let node = this.jsxParseNamespacedName(); - while (this.eat(tt.dot)) { - const newNode = this.startNodeAt(startPos, startLoc); - newNode.object = node; - newNode.property = this.jsxParseIdentifier(); - node = this.finishNode(newNode, "JSXMemberExpression"); + // Parses element name in any form - namespaced, member + // or single identifier. + + jsxParseElementName() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + let node = this.jsxParseNamespacedName(); + while (this.eat(tt.dot)) { + const newNode = this.startNodeAt(startPos, startLoc); + newNode.object = node; + newNode.property = this.jsxParseIdentifier(); + node = this.finishNode(newNode, "JSXMemberExpression"); + } + return node; } - return node; -}; -// Parses any type of JSX attribute value. + // Parses any type of JSX attribute value. -pp.jsxParseAttributeValue = function() { - let node; - switch (this.state.type) { - case tt.braceL: - node = this.jsxParseExpressionContainer(); - if (node.expression.type === "JSXEmptyExpression") { - this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); - } else { - return node; - } + jsxParseAttributeValue() { + let node; + switch (this.state.type) { + case tt.braceL: + node = this.jsxParseExpressionContainer(); + if (node.expression.type === "JSXEmptyExpression") { + this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); + } else { + return node; + } - case tt.jsxTagStart: - case tt.string: - return this.parseExprAtom(); + case tt.jsxTagStart: + case tt.string: + return this.parseExprAtom(); - default: - this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); + default: + this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); + } } -}; - -// JSXEmptyExpression is unique type since it doesn't actually parse anything, -// and so it should start at the end of last read token (left brace) and finish -// at the beginning of the next one (right brace). -pp.jsxParseEmptyExpression = function() { - const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc); - return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc); -}; - -// Parse JSX spread child + // JSXEmptyExpression is unique type since it doesn't actually parse anything, + // and so it should start at the end of last read token (left brace) and finish + // at the beginning of the next one (right brace). -pp.jsxParseSpreadChild = function() { - const node = this.startNode(); - this.expect(tt.braceL); - this.expect(tt.ellipsis); - node.expression = this.parseExpression(); - this.expect(tt.braceR); - - return this.finishNode(node, "JSXSpreadChild"); -}; - -// Parses JSX expression enclosed into curly brackets. + jsxParseEmptyExpression() { + const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc); + } + // Parse JSX spread child -pp.jsxParseExpressionContainer = function() { - const node = this.startNode(); - this.next(); - if (this.match(tt.braceR)) { - node.expression = this.jsxParseEmptyExpression(); - } else { + jsxParseSpreadChild() { + const node = this.startNode(); + this.expect(tt.braceL); + this.expect(tt.ellipsis); node.expression = this.parseExpression(); + this.expect(tt.braceR); + + return this.finishNode(node, "JSXSpreadChild"); } - this.expect(tt.braceR); - return this.finishNode(node, "JSXExpressionContainer"); -}; -// Parses following JSX attribute name-value pair. + // Parses JSX expression enclosed into curly brackets. -pp.jsxParseAttribute = function() { - const node = this.startNode(); - if (this.eat(tt.braceL)) { - this.expect(tt.ellipsis); - node.argument = this.parseMaybeAssign(); + + jsxParseExpressionContainer() { + const node = this.startNode(); + this.next(); + if (this.match(tt.braceR)) { + node.expression = this.jsxParseEmptyExpression(); + } else { + node.expression = this.parseExpression(); + } this.expect(tt.braceR); - return this.finishNode(node, "JSXSpreadAttribute"); + return this.finishNode(node, "JSXExpressionContainer"); } - node.name = this.jsxParseNamespacedName(); - node.value = this.eat(tt.eq) ? this.jsxParseAttributeValue() : null; - return this.finishNode(node, "JSXAttribute"); -}; -// Parses JSX opening tag starting after "<". + // Parses following JSX attribute name-value pair. -pp.jsxParseOpeningElementAt = function(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - node.attributes = []; - node.name = this.jsxParseElementName(); - while (!this.match(tt.slash) && !this.match(tt.jsxTagEnd)) { - node.attributes.push(this.jsxParseAttribute()); + jsxParseAttribute() { + const node = this.startNode(); + if (this.eat(tt.braceL)) { + this.expect(tt.ellipsis); + node.argument = this.parseMaybeAssign(); + this.expect(tt.braceR); + return this.finishNode(node, "JSXSpreadAttribute"); + } + node.name = this.jsxParseNamespacedName(); + node.value = this.eat(tt.eq) ? this.jsxParseAttributeValue() : null; + return this.finishNode(node, "JSXAttribute"); } - node.selfClosing = this.eat(tt.slash); - this.expect(tt.jsxTagEnd); - return this.finishNode(node, "JSXOpeningElement"); -}; - -// Parses JSX closing tag starting after "" + ); } } - if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { - this.raise( - closingElement.start, - "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">" - ); + node.openingElement = openingElement; + node.closingElement = closingElement; + node.children = children; + if (this.match(tt.relational) && this.state.value === "<") { + this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); } + return this.finishNode(node, "JSXElement"); } - node.openingElement = openingElement; - node.closingElement = closingElement; - node.children = children; - if (this.match(tt.relational) && this.state.value === "<") { - this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); - } - return this.finishNode(node, "JSXElement"); -}; + // Parses entire JSX element from current position. -// Parses entire JSX element from current position. + jsxParseElement() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + this.next(); + return this.jsxParseElementAt(startPos, startLoc); + } -pp.jsxParseElement = function() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - this.next(); - return this.jsxParseElementAt(startPos, startLoc); -}; + // ================================== + // Overrides + // ================================== -export default (superClass) => class extends superClass { parseExprAtom(refShortHandDefaultPos) { if (this.match(tt.jsxText)) { return this.parseLiteral(this.state.value, "JSXText"); From c4fb3fe742c61ee2dd0ab1b1197a254d3c9f6a55 Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 23 Apr 2017 15:40:49 -0700 Subject: [PATCH 093/105] Convert each file with parser methods to a class in an inheritance chain (#481) --- src/parser/base.js | 24 + src/parser/comments.js | 206 ++--- src/parser/expression.js | 1780 ++++++++++++++++++------------------- src/parser/index.js | 31 +- src/parser/location.js | 22 +- src/parser/lval.js | 455 +++++----- src/parser/node.js | 65 +- src/parser/statement.js | 1813 +++++++++++++++++++------------------- src/parser/util.js | 118 +-- src/tokenizer/index.js | 10 +- 10 files changed, 2264 insertions(+), 2260 deletions(-) create mode 100644 src/parser/base.js diff --git a/src/parser/base.js b/src/parser/base.js new file mode 100644 index 0000000000..fa1fc13539 --- /dev/null +++ b/src/parser/base.js @@ -0,0 +1,24 @@ +// @flow + +import type { Options } from "../options"; +import { reservedWords } from "../util/identifier"; + +export default class BaseParser { + // Properties set by constructor in index.js + options: Options; + inModule: boolean; + plugins: { [key: string]: boolean }; + filename: ?string; + + isReservedWord(word: string): boolean { + if (word === "await") { + return this.inModule; + } else { + return reservedWords[6](word); + } + } + + hasPlugin(name: string): boolean { + return !!this.plugins[name]; + } +} diff --git a/src/parser/comments.js b/src/parser/comments.js index c032e85e07..a634491848 100644 --- a/src/parser/comments.js +++ b/src/parser/comments.js @@ -24,133 +24,133 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import Parser from "./index"; +import BaseParser from "./base"; function last(stack) { return stack[stack.length - 1]; } -const pp = Parser.prototype; - -pp.addComment = function (comment) { - if (this.filename) comment.loc.filename = this.filename; - this.state.trailingComments.push(comment); - this.state.leadingComments.push(comment); -}; +export default class CommentsParser extends BaseParser { + addComment(comment) { + if (this.filename) comment.loc.filename = this.filename; + this.state.trailingComments.push(comment); + this.state.leadingComments.push(comment); + } -pp.processComment = function (node) { - if (node.type === "Program" && node.body.length > 0) return; + processComment(node) { + if (node.type === "Program" && node.body.length > 0) return; - const stack = this.state.commentStack; + const stack = this.state.commentStack; - let lastChild, trailingComments, i, j; + let lastChild, trailingComments, i, j; - if (this.state.trailingComments.length > 0) { - // If the first comment in trailingComments comes after the - // current node, then we're good - all comments in the array will - // come after the node and so it's safe to add them as official - // trailingComments. - if (this.state.trailingComments[0].start >= node.end) { - trailingComments = this.state.trailingComments; - this.state.trailingComments = []; + if (this.state.trailingComments.length > 0) { + // If the first comment in trailingComments comes after the + // current node, then we're good - all comments in the array will + // come after the node and so it's safe to add them as official + // trailingComments. + if (this.state.trailingComments[0].start >= node.end) { + trailingComments = this.state.trailingComments; + this.state.trailingComments = []; + } else { + // Otherwise, if the first comment doesn't come after the + // current node, that means we have a mix of leading and trailing + // comments in the array and that leadingComments contains the + // same items as trailingComments. Reset trailingComments to + // zero items and we'll handle this by evaluating leadingComments + // later. + this.state.trailingComments.length = 0; + } } else { - // Otherwise, if the first comment doesn't come after the - // current node, that means we have a mix of leading and trailing - // comments in the array and that leadingComments contains the - // same items as trailingComments. Reset trailingComments to - // zero items and we'll handle this by evaluating leadingComments - // later. - this.state.trailingComments.length = 0; - } - } else { - const lastInStack = last(stack); - if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { - trailingComments = lastInStack.trailingComments; - lastInStack.trailingComments = null; + const lastInStack = last(stack); + if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { + trailingComments = lastInStack.trailingComments; + lastInStack.trailingComments = null; + } } - } - // Eating the stack. - while (stack.length > 0 && last(stack).start >= node.start) { - lastChild = stack.pop(); - } + // Eating the stack. + while (stack.length > 0 && last(stack).start >= node.start) { + lastChild = stack.pop(); + } - if (lastChild) { - if (lastChild.leadingComments) { - if (lastChild !== node && last(lastChild.leadingComments).end <= node.start) { - node.leadingComments = lastChild.leadingComments; - lastChild.leadingComments = null; - } else { - // A leading comment for an anonymous class had been stolen by its first ClassMethod, - // so this takes back the leading comment. - // See also: https://github.com/eslint/espree/issues/158 - for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { - if (lastChild.leadingComments[i].end <= node.start) { - node.leadingComments = lastChild.leadingComments.splice(0, i + 1); - break; + if (lastChild) { + if (lastChild.leadingComments) { + if (lastChild !== node && last(lastChild.leadingComments).end <= node.start) { + node.leadingComments = lastChild.leadingComments; + lastChild.leadingComments = null; + } else { + // A leading comment for an anonymous class had been stolen by its first ClassMethod, + // so this takes back the leading comment. + // See also: https://github.com/eslint/espree/issues/158 + for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { + if (lastChild.leadingComments[i].end <= node.start) { + node.leadingComments = lastChild.leadingComments.splice(0, i + 1); + break; + } } } } - } - } else if (this.state.leadingComments.length > 0) { - if (last(this.state.leadingComments).end <= node.start) { - if (this.state.commentPreviousNode) { - for (j = 0; j < this.state.leadingComments.length; j++) { - if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { - this.state.leadingComments.splice(j, 1); - j--; + } else if (this.state.leadingComments.length > 0) { + if (last(this.state.leadingComments).end <= node.start) { + if (this.state.commentPreviousNode) { + for (j = 0; j < this.state.leadingComments.length; j++) { + if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) { + this.state.leadingComments.splice(j, 1); + j--; + } } } - } - if (this.state.leadingComments.length > 0) { - node.leadingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } else { - // https://github.com/eslint/espree/issues/2 - // - // In special cases, such as return (without a value) and - // debugger, all comments will end up as leadingComments and - // will otherwise be eliminated. This step runs when the - // commentStack is empty and there are comments left - // in leadingComments. - // - // This loop figures out the stopping point between the actual - // leading and trailing comments by finding the location of the - // first comment that comes after the given node. - for (i = 0; i < this.state.leadingComments.length; i++) { - if (this.state.leadingComments[i].end > node.start) { - break; + if (this.state.leadingComments.length > 0) { + node.leadingComments = this.state.leadingComments; + this.state.leadingComments = []; + } + } else { + // https://github.com/eslint/espree/issues/2 + // + // In special cases, such as return (without a value) and + // debugger, all comments will end up as leadingComments and + // will otherwise be eliminated. This step runs when the + // commentStack is empty and there are comments left + // in leadingComments. + // + // This loop figures out the stopping point between the actual + // leading and trailing comments by finding the location of the + // first comment that comes after the given node. + for (i = 0; i < this.state.leadingComments.length; i++) { + if (this.state.leadingComments[i].end > node.start) { + break; + } } - } - // Split the array based on the location of the first comment - // that comes after the node. Keep in mind that this could - // result in an empty array, and if so, the array must be - // deleted. - node.leadingComments = this.state.leadingComments.slice(0, i); - if ((node.leadingComments: Array).length === 0) { - node.leadingComments = null; - } + // Split the array based on the location of the first comment + // that comes after the node. Keep in mind that this could + // result in an empty array, and if so, the array must be + // deleted. + node.leadingComments = this.state.leadingComments.slice(0, i); + if ((node.leadingComments: Array).length === 0) { + node.leadingComments = null; + } - // Similarly, trailing comments are attached later. The variable - // must be reset to null if there are no trailing comments. - trailingComments = this.state.leadingComments.slice(i); - if (trailingComments.length === 0) { - trailingComments = null; + // Similarly, trailing comments are attached later. The variable + // must be reset to null if there are no trailing comments. + trailingComments = this.state.leadingComments.slice(i); + if (trailingComments.length === 0) { + trailingComments = null; + } } } - } - this.state.commentPreviousNode = node; + this.state.commentPreviousNode = node; - if (trailingComments) { - if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { - node.innerComments = trailingComments; - } else { - node.trailingComments = trailingComments; + if (trailingComments) { + if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { + node.innerComments = trailingComments; + } else { + node.trailingComments = trailingComments; + } } - } - stack.push(node); -}; + stack.push(node); + } +} diff --git a/src/parser/expression.js b/src/parser/expression.js index e813460314..168e595415 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -19,1104 +19,1104 @@ // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser import { types as tt } from "../tokenizer/types"; -import Parser from "./index"; +import LValParser from "./lval"; import { reservedWords } from "../util/identifier"; -const pp = Parser.prototype; +export default class ExpressionParser extends LValParser { + // Check if property name clashes with already added. + // Object/class getters and setters are not allowed to clash — + // either with each other or with an init property — and in + // strict mode, init properties are also not allowed to be repeated. -// Check if property name clashes with already added. -// Object/class getters and setters are not allowed to clash — -// either with each other or with an init property — and in -// strict mode, init properties are also not allowed to be repeated. + checkPropClash(prop, propHash) { + if (prop.computed || prop.kind) return; -pp.checkPropClash = function (prop, propHash) { - if (prop.computed || prop.kind) return; + const key = prop.key; + // It is either an Identifier or a String/NumericLiteral + const name = key.type === "Identifier" ? key.name : String(key.value); - const key = prop.key; - // It is either an Identifier or a String/NumericLiteral - const name = key.type === "Identifier" ? key.name : String(key.value); - - if (name === "__proto__") { - if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); - propHash.proto = true; + if (name === "__proto__") { + if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); + propHash.proto = true; + } } -}; - -// Convenience method to parse an Expression only -pp.getExpression = function() { - this.nextToken(); - const expr = this.parseExpression(); - if (!this.match(tt.eof)) { - this.unexpected(); + + // Convenience method to parse an Expression only + getExpression() { + this.nextToken(); + const expr = this.parseExpression(); + if (!this.match(tt.eof)) { + this.unexpected(); + } + return expr; } - return expr; -}; - -// ### Expression parsing - -// These nest, from the most general expression type at the top to -// 'atomic', nondivisible expression types at the bottom. Most of -// the functions will simply let the function (s) below them parse, -// and, *if* the syntactic construct they handle is present, wrap -// the AST node that the inner parser gave them in another node. - -// Parse a full expression. The optional arguments are used to -// forbid the `in` operator (in for loops initialization expressions) -// and provide reference for storing '=' operator inside shorthand -// property assignment in contexts where both object expression -// and object pattern might appear (so it's possible to raise -// delayed syntax error at correct position). - -pp.parseExpression = function (noIn, refShorthandDefaultPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos); - if (this.match(tt.comma)) { - const node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - while (this.eat(tt.comma)) { - node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos)); + + // ### Expression parsing + + // These nest, from the most general expression type at the top to + // 'atomic', nondivisible expression types at the bottom. Most of + // the functions will simply let the function (s) below them parse, + // and, *if* the syntactic construct they handle is present, wrap + // the AST node that the inner parser gave them in another node. + + // Parse a full expression. The optional arguments are used to + // forbid the `in` operator (in for loops initialization expressions) + // and provide reference for storing '=' operator inside shorthand + // property assignment in contexts where both object expression + // and object pattern might appear (so it's possible to raise + // delayed syntax error at correct position). + + parseExpression(noIn, refShorthandDefaultPos) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos); + if (this.match(tt.comma)) { + const node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(tt.comma)) { + node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos)); + } + this.toReferencedList(node.expressions); + return this.finishNode(node, "SequenceExpression"); } - this.toReferencedList(node.expressions); - return this.finishNode(node, "SequenceExpression"); + return expr; } - return expr; -}; -// Parse an assignment expression. This includes applications of -// operators like `+=`. + // Parse an assignment expression. This includes applications of + // operators like `+=`. -pp.parseMaybeAssign = function (noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; + parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; - if (this.match(tt._yield) && this.state.inGenerator) { - let left = this.parseYield(); - if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); - return left; - } + if (this.match(tt._yield) && this.state.inGenerator) { + let left = this.parseYield(); + if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); + return left; + } - let failOnShorthandAssign; - if (refShorthandDefaultPos) { - failOnShorthandAssign = false; - } else { - refShorthandDefaultPos = { start: 0 }; - failOnShorthandAssign = true; - } + let failOnShorthandAssign; + if (refShorthandDefaultPos) { + failOnShorthandAssign = false; + } else { + refShorthandDefaultPos = { start: 0 }; + failOnShorthandAssign = true; + } - if (this.match(tt.parenL) || this.match(tt.name)) { - this.state.potentialArrowAt = this.state.start; - } + if (this.match(tt.parenL) || this.match(tt.name)) { + this.state.potentialArrowAt = this.state.start; + } - let left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos); - if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); - if (this.state.type.isAssign) { - const node = this.startNodeAt(startPos, startLoc); - node.operator = this.state.value; - node.left = this.match(tt.eq) ? this.toAssignable(left, undefined, "assignment expression") : left; - refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly - - this.checkLVal(left, undefined, undefined, "assignment expression"); - - if (left.extra && left.extra.parenthesized) { - let errorMsg; - if (left.type === "ObjectPattern") { - errorMsg = "`({a}) = 0` use `({a} = 0)`"; - } else if (left.type === "ArrayPattern") { - errorMsg = "`([a]) = 0` use `([a] = 0)`"; - } - if (errorMsg) { - this.raise(left.start, `You're trying to assign to a parenthesized expression, eg. instead of ${errorMsg}`); + let left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos); + if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); + if (this.state.type.isAssign) { + const node = this.startNodeAt(startPos, startLoc); + node.operator = this.state.value; + node.left = this.match(tt.eq) ? this.toAssignable(left, undefined, "assignment expression") : left; + refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly + + this.checkLVal(left, undefined, undefined, "assignment expression"); + + if (left.extra && left.extra.parenthesized) { + let errorMsg; + if (left.type === "ObjectPattern") { + errorMsg = "`({a}) = 0` use `({a} = 0)`"; + } else if (left.type === "ArrayPattern") { + errorMsg = "`([a]) = 0` use `([a] = 0)`"; + } + if (errorMsg) { + this.raise(left.start, `You're trying to assign to a parenthesized expression, eg. instead of ${errorMsg}`); + } } + + this.next(); + node.right = this.parseMaybeAssign(noIn); + return this.finishNode(node, "AssignmentExpression"); + } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { + this.unexpected(refShorthandDefaultPos.start); } - this.next(); - node.right = this.parseMaybeAssign(noIn); - return this.finishNode(node, "AssignmentExpression"); - } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); + return left; } - return left; -}; + // Parse a ternary conditional (`?:`) operator. -// Parse a ternary conditional (`?:`) operator. + parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const expr = this.parseExprOps(noIn, refShorthandDefaultPos); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; -pp.parseMaybeConditional = function (noIn, refShorthandDefaultPos, refNeedsArrowPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const expr = this.parseExprOps(noIn, refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - - return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); -}; + return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); + } -pp.parseConditional = function (expr, noIn, startPos, startLoc) { - if (this.eat(tt.question)) { - const node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(tt.colon); - node.alternate = this.parseMaybeAssign(noIn); - return this.finishNode(node, "ConditionalExpression"); + parseConditional(expr, noIn, startPos, startLoc) { + if (this.eat(tt.question)) { + const node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(tt.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; } - return expr; -}; -// Start the precedence parser. + // Start the precedence parser. -pp.parseExprOps = function (noIn, refShorthandDefaultPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const expr = this.parseMaybeUnary(refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { - return expr; - } else { - return this.parseExprOp(expr, startPos, startLoc, -1, noIn); + parseExprOps(noIn, refShorthandDefaultPos) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const expr = this.parseMaybeUnary(refShorthandDefaultPos); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) { + return expr; + } else { + return this.parseExprOp(expr, startPos, startLoc, -1, noIn); + } } -}; - -// Parse binary operators with the operator precedence parsing -// algorithm. `left` is the left-hand side of the operator. -// `minPrec` provides context that allows the function to stop and -// defer further parser to one of its callers when it encounters an -// operator that has a lower precedence than the set it is parsing. - -pp.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { - const prec = this.state.type.binop; - if (prec != null && (!noIn || !this.match(tt._in))) { - if (prec > minPrec) { - const node = this.startNodeAt(leftStartPos, leftStartLoc); - node.left = left; - node.operator = this.state.value; - if ( - node.operator === "**" && - left.type === "UnaryExpression" && - left.extra && - !left.extra.parenthesizedArgument && - !left.extra.parenthesized - ) { - this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses."); - } + // Parse binary operators with the operator precedence parsing + // algorithm. `left` is the left-hand side of the operator. + // `minPrec` provides context that allows the function to stop and + // defer further parser to one of its callers when it encounters an + // operator that has a lower precedence than the set it is parsing. + + parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) { + const prec = this.state.type.binop; + if (prec != null && (!noIn || !this.match(tt._in))) { + if (prec > minPrec) { + const node = this.startNodeAt(leftStartPos, leftStartLoc); + node.left = left; + node.operator = this.state.value; + + if ( + node.operator === "**" && + left.type === "UnaryExpression" && + left.extra && + !left.extra.parenthesizedArgument && + !left.extra.parenthesized + ) { + this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses."); + } - const op = this.state.type; - this.next(); + const op = this.state.type; + this.next(); - const startPos = this.state.start; - const startLoc = this.state.startLoc; - node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn); + const startPos = this.state.start; + const startLoc = this.state.startLoc; + node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn); - this.finishNode(node, (op === tt.logicalOR || op === tt.logicalAND) ? "LogicalExpression" : "BinaryExpression"); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); + this.finishNode(node, (op === tt.logicalOR || op === tt.logicalAND) ? "LogicalExpression" : "BinaryExpression"); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); + } } + return left; } - return left; -}; -// Parse unary operators, both prefix and postfix. + // Parse unary operators, both prefix and postfix. -pp.parseMaybeUnary = function (refShorthandDefaultPos) { - if (this.state.type.prefix) { - const node = this.startNode(); - const update = this.match(tt.incDec); - node.operator = this.state.value; - node.prefix = true; - this.next(); + parseMaybeUnary(refShorthandDefaultPos) { + if (this.state.type.prefix) { + const node = this.startNode(); + const update = this.match(tt.incDec); + node.operator = this.state.value; + node.prefix = true; + this.next(); - const argType = this.state.type; - node.argument = this.parseMaybeUnary(); + const argType = this.state.type; + node.argument = this.parseMaybeUnary(); - this.addExtra(node, "parenthesizedArgument", argType === tt.parenL && (!node.argument.extra || !node.argument.extra.parenthesized)); + this.addExtra(node, "parenthesizedArgument", argType === tt.parenL && (!node.argument.extra || !node.argument.extra.parenthesized)); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } + if (refShorthandDefaultPos && refShorthandDefaultPos.start) { + this.unexpected(refShorthandDefaultPos.start); + } + + if (update) { + this.checkLVal(node.argument, undefined, undefined, "prefix operation"); + } else if (this.state.strict && node.operator === "delete" && node.argument.type === "Identifier") { + this.raise(node.start, "Deleting local variable in strict mode"); + } - if (update) { - this.checkLVal(node.argument, undefined, undefined, "prefix operation"); - } else if (this.state.strict && node.operator === "delete" && node.argument.type === "Identifier") { - this.raise(node.start, "Deleting local variable in strict mode"); + return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); } - return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + const startPos = this.state.start; + const startLoc = this.state.startLoc; + let expr = this.parseExprSubscripts(refShorthandDefaultPos); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; + while (this.state.type.postfix && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startPos, startLoc); + node.operator = this.state.value; + node.prefix = false; + node.argument = expr; + this.checkLVal(expr, undefined, undefined, "postfix operation"); + this.next(); + expr = this.finishNode(node, "UpdateExpression"); + } + return expr; } - const startPos = this.state.start; - const startLoc = this.state.startLoc; - let expr = this.parseExprSubscripts(refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - while (this.state.type.postfix && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startPos, startLoc); - node.operator = this.state.value; - node.prefix = false; - node.argument = expr; - this.checkLVal(expr, undefined, undefined, "postfix operation"); - this.next(); - expr = this.finishNode(node, "UpdateExpression"); - } - return expr; -}; + // Parse call, dot, and `[]`-subscript expressions. -// Parse call, dot, and `[]`-subscript expressions. + parseExprSubscripts(refShorthandDefaultPos) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseExprAtom(refShorthandDefaultPos); -pp.parseExprSubscripts = function (refShorthandDefaultPos) { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const potentialArrowAt = this.state.potentialArrowAt; - const expr = this.parseExprAtom(refShorthandDefaultPos); + if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { + return expr; + } - if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) { - return expr; - } + if (refShorthandDefaultPos && refShorthandDefaultPos.start) { + return expr; + } - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { - return expr; + return this.parseSubscripts(expr, startPos, startLoc); } - return this.parseSubscripts(expr, startPos, startLoc); -}; - -pp.parseSubscripts = function (base, startPos, startLoc, noCalls) { - for (;;) { - if (!noCalls && this.eat(tt.doubleColon)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.callee = this.parseNoCallExpr(); - return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls); - } else if (this.eat(tt.dot)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseIdentifier(true); - node.computed = false; - base = this.finishNode(node, "MemberExpression"); - } else if (this.eat(tt.bracketL)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseExpression(); - node.computed = true; - this.expect(tt.bracketR); - base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.match(tt.parenL)) { - const possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon(); - this.next(); + parseSubscripts(base, startPos, startLoc, noCalls) { + for (;;) { + if (!noCalls && this.eat(tt.doubleColon)) { + const node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.callee = this.parseNoCallExpr(); + return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls); + } else if (this.eat(tt.dot)) { + const node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = this.parseIdentifier(true); + node.computed = false; + base = this.finishNode(node, "MemberExpression"); + } else if (this.eat(tt.bracketL)) { + const node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = this.parseExpression(); + node.computed = true; + this.expect(tt.bracketR); + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.match(tt.parenL)) { + const possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon(); + this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = this.parseCallExpressionArguments(tt.parenR, possibleAsync); - if (node.callee.type === "Import" && node.arguments.length !== 1) { - this.raise(node.start, "import() requires exactly one argument"); - } - base = this.finishNode(node, "CallExpression"); + const node = this.startNodeAt(startPos, startLoc); + node.callee = base; + node.arguments = this.parseCallExpressionArguments(tt.parenR, possibleAsync); + if (node.callee.type === "Import" && node.arguments.length !== 1) { + this.raise(node.start, "import() requires exactly one argument"); + } + base = this.finishNode(node, "CallExpression"); - if (possibleAsync && this.shouldParseAsyncArrow()) { - return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); + if (possibleAsync && this.shouldParseAsyncArrow()) { + return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); + } else { + this.toReferencedList(node.arguments); + } + } else if (this.match(tt.backQuote)) { + const node = this.startNodeAt(startPos, startLoc); + node.tag = base; + node.quasi = this.parseTemplate(true); + base = this.finishNode(node, "TaggedTemplateExpression"); } else { - this.toReferencedList(node.arguments); + return base; } - } else if (this.match(tt.backQuote)) { - const node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate(true); - base = this.finishNode(node, "TaggedTemplateExpression"); - } else { - return base; } } -}; -pp.parseCallExpressionArguments = function (close, possibleAsyncArrow) { - const elts = []; - let innerParenStart; - let first = true; + parseCallExpressionArguments(close, possibleAsyncArrow) { + const elts = []; + let innerParenStart; + let first = true; - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(tt.comma); - if (this.eat(close)) break; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(tt.comma); + if (this.eat(close)) break; + } + + // we need to make sure that if this is an async arrow functions, that we don't allow inner parens inside the params + if (this.match(tt.parenL) && !innerParenStart) { + innerParenStart = this.state.start; + } + + elts.push(this.parseExprListItem(false, possibleAsyncArrow ? { start: 0 } : undefined, possibleAsyncArrow ? { start: 0 } : undefined)); } - // we need to make sure that if this is an async arrow functions, that we don't allow inner parens inside the params - if (this.match(tt.parenL) && !innerParenStart) { - innerParenStart = this.state.start; + // we found an async arrow function so let's not allow any inner parens + if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) { + this.unexpected(); } - elts.push(this.parseExprListItem(false, possibleAsyncArrow ? { start: 0 } : undefined, possibleAsyncArrow ? { start: 0 } : undefined)); + return elts; } - // we found an async arrow function so let's not allow any inner parens - if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) { - this.unexpected(); + shouldParseAsyncArrow() { + return this.match(tt.arrow); } - return elts; -}; + parseAsyncArrowFromCallExpression(node, call) { + this.expect(tt.arrow); + return this.parseArrowExpression(node, call.arguments, true); + } -pp.shouldParseAsyncArrow = function () { - return this.match(tt.arrow); -}; + // Parse a no-call expression (like argument of `new` or `::` operators). -pp.parseAsyncArrowFromCallExpression = function (node, call) { - this.expect(tt.arrow); - return this.parseArrowExpression(node, call.arguments, true); -}; + parseNoCallExpr() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + } -// Parse a no-call expression (like argument of `new` or `::` operators). + // Parse an atomic expression — either a single token that is an + // expression, an expression started by a keyword like `function` or + // `new`, or an expression wrapped in punctuation like `()`, `[]`, + // or `{}`. -pp.parseNoCallExpr = function () { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); -}; + parseExprAtom(refShorthandDefaultPos) { + const canBeArrow = this.state.potentialArrowAt === this.state.start; + let node; -// Parse an atomic expression — either a single token that is an -// expression, an expression started by a keyword like `function` or -// `new`, or an expression wrapped in punctuation like `()`, `[]`, -// or `{}`. + switch (this.state.type) { + case tt._super: + if (!this.state.inMethod && !this.options.allowSuperOutsideMethod) { + this.raise(this.state.start, "'super' outside of function or class"); + } -pp.parseExprAtom = function (refShorthandDefaultPos) { - const canBeArrow = this.state.potentialArrowAt === this.state.start; - let node; + node = this.startNode(); + this.next(); + if (!this.match(tt.parenL) && !this.match(tt.bracketL) && !this.match(tt.dot)) { + this.unexpected(); + } + if (this.match(tt.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) { + this.raise(node.start, "super() is only valid inside a class constructor. Make sure the method name is spelled exactly as 'constructor'."); + } + return this.finishNode(node, "Super"); - switch (this.state.type) { - case tt._super: - if (!this.state.inMethod && !this.options.allowSuperOutsideMethod) { - this.raise(this.state.start, "'super' outside of function or class"); - } + case tt._import: + if (!this.hasPlugin("dynamicImport")) this.unexpected(); - node = this.startNode(); - this.next(); - if (!this.match(tt.parenL) && !this.match(tt.bracketL) && !this.match(tt.dot)) { - this.unexpected(); - } - if (this.match(tt.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) { - this.raise(node.start, "super() is only valid inside a class constructor. Make sure the method name is spelled exactly as 'constructor'."); - } - return this.finishNode(node, "Super"); + node = this.startNode(); + this.next(); + if (!this.match(tt.parenL)) { + this.unexpected(null, tt.parenL); + } + return this.finishNode(node, "Import"); - case tt._import: - if (!this.hasPlugin("dynamicImport")) this.unexpected(); + case tt._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + + case tt._yield: + if (this.state.inGenerator) this.unexpected(); + + case tt.name: + node = this.startNode(); + const allowAwait = this.state.value === "await" && this.state.inAsync; + const allowYield = this.shouldAllowYieldIdentifier(); + const id = this.parseIdentifier(allowAwait || allowYield); + + if (id.name === "await") { + if (this.state.inAsync || this.inModule) { + return this.parseAwait(node); + } + } else if (id.name === "async" && this.match(tt._function) && !this.canInsertSemicolon()) { + this.next(); + return this.parseFunction(node, false, false, true); + } else if (canBeArrow && id.name === "async" && this.match(tt.name)) { + const params = [this.parseIdentifier()]; + this.expect(tt.arrow); + // let foo = bar => {}; + return this.parseArrowExpression(node, params, true); + } - node = this.startNode(); - this.next(); - if (!this.match(tt.parenL)) { - this.unexpected(null, tt.parenL); - } - return this.finishNode(node, "Import"); + if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) { + return this.parseArrowExpression(node, [id]); + } - case tt._this: - node = this.startNode(); - this.next(); - return this.finishNode(node, "ThisExpression"); + return id; + + case tt._do: + if (this.hasPlugin("doExpressions")) { + const node = this.startNode(); + this.next(); + const oldInFunction = this.state.inFunction; + const oldLabels = this.state.labels; + this.state.labels = []; + this.state.inFunction = false; + node.body = this.parseBlock(false, true); + this.state.inFunction = oldInFunction; + this.state.labels = oldLabels; + return this.finishNode(node, "DoExpression"); + } - case tt._yield: - if (this.state.inGenerator) this.unexpected(); + case tt.regexp: + const value = this.state.value; + node = this.parseLiteral(value.value, "RegExpLiteral"); + node.pattern = value.pattern; + node.flags = value.flags; + return node; - case tt.name: - node = this.startNode(); - const allowAwait = this.state.value === "await" && this.state.inAsync; - const allowYield = this.shouldAllowYieldIdentifier(); - const id = this.parseIdentifier(allowAwait || allowYield); + case tt.num: + return this.parseLiteral(this.state.value, "NumericLiteral"); - if (id.name === "await") { - if (this.state.inAsync || this.inModule) { - return this.parseAwait(node); - } - } else if (id.name === "async" && this.match(tt._function) && !this.canInsertSemicolon()) { + case tt.string: + return this.parseLiteral(this.state.value, "StringLiteral"); + + case tt._null: + node = this.startNode(); this.next(); - return this.parseFunction(node, false, false, true); - } else if (canBeArrow && id.name === "async" && this.match(tt.name)) { - const params = [this.parseIdentifier()]; - this.expect(tt.arrow); - // let foo = bar => {}; - return this.parseArrowExpression(node, params, true); - } + return this.finishNode(node, "NullLiteral"); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) { - return this.parseArrowExpression(node, [id]); - } + case tt._true: case tt._false: + node = this.startNode(); + node.value = this.match(tt._true); + this.next(); + return this.finishNode(node, "BooleanLiteral"); - return id; + case tt.parenL: + return this.parseParenAndDistinguishExpression(null, null, canBeArrow); - case tt._do: - if (this.hasPlugin("doExpressions")) { - const node = this.startNode(); + case tt.bracketL: + node = this.startNode(); this.next(); - const oldInFunction = this.state.inFunction; - const oldLabels = this.state.labels; - this.state.labels = []; - this.state.inFunction = false; - node.body = this.parseBlock(false, true); - this.state.inFunction = oldInFunction; - this.state.labels = oldLabels; - return this.finishNode(node, "DoExpression"); - } - - case tt.regexp: - const value = this.state.value; - node = this.parseLiteral(value.value, "RegExpLiteral"); - node.pattern = value.pattern; - node.flags = value.flags; - return node; + node.elements = this.parseExprList(tt.bracketR, true, refShorthandDefaultPos); + this.toReferencedList(node.elements); + return this.finishNode(node, "ArrayExpression"); - case tt.num: - return this.parseLiteral(this.state.value, "NumericLiteral"); + case tt.braceL: + return this.parseObj(false, refShorthandDefaultPos); - case tt.string: - return this.parseLiteral(this.state.value, "StringLiteral"); + case tt._function: + return this.parseFunctionExpression(); - case tt._null: - node = this.startNode(); - this.next(); - return this.finishNode(node, "NullLiteral"); + case tt.at: + this.parseDecorators(); - case tt._true: case tt._false: - node = this.startNode(); - node.value = this.match(tt._true); - this.next(); - return this.finishNode(node, "BooleanLiteral"); + case tt._class: + node = this.startNode(); + this.takeDecorators(node); + return this.parseClass(node, false); - case tt.parenL: - return this.parseParenAndDistinguishExpression(null, null, canBeArrow); + case tt._new: + return this.parseNew(); - case tt.bracketL: - node = this.startNode(); - this.next(); - node.elements = this.parseExprList(tt.bracketR, true, refShorthandDefaultPos); - this.toReferencedList(node.elements); - return this.finishNode(node, "ArrayExpression"); + case tt.backQuote: + return this.parseTemplate(false); - case tt.braceL: - return this.parseObj(false, refShorthandDefaultPos); + case tt.doubleColon: + node = this.startNode(); + this.next(); + node.object = null; + const callee = node.callee = this.parseNoCallExpr(); + if (callee.type === "MemberExpression") { + return this.finishNode(node, "BindExpression"); + } else { + this.raise(callee.start, "Binding should be performed on object property."); + } - case tt._function: - return this.parseFunctionExpression(); + default: + this.unexpected(); + } + } - case tt.at: - this.parseDecorators(); + parseFunctionExpression() { + const node = this.startNode(); + const meta = this.parseIdentifier(true); + if (this.state.inGenerator && this.eat(tt.dot) && this.hasPlugin("functionSent")) { + return this.parseMetaProperty(node, meta, "sent"); + } else { + return this.parseFunction(node, false); + } + } - case tt._class: - node = this.startNode(); - this.takeDecorators(node); - return this.parseClass(node, false); + parseMetaProperty(node, meta, propertyName) { + node.meta = meta; + node.property = this.parseIdentifier(true); - case tt._new: - return this.parseNew(); + if (node.property.name !== propertyName) { + this.raise(node.property.start, `The only valid meta property for new is ${meta.name}.${propertyName}`); + } - case tt.backQuote: - return this.parseTemplate(false); + return this.finishNode(node, "MetaProperty"); + } - case tt.doubleColon: - node = this.startNode(); - this.next(); - node.object = null; - const callee = node.callee = this.parseNoCallExpr(); - if (callee.type === "MemberExpression") { - return this.finishNode(node, "BindExpression"); - } else { - this.raise(callee.start, "Binding should be performed on object property."); - } + parseLiteral(value, type, startPos, startLoc) { + startPos = startPos || this.state.start; + startLoc = startLoc || this.state.startLoc; - default: - this.unexpected(); - } -}; - -pp.parseFunctionExpression = function () { - const node = this.startNode(); - const meta = this.parseIdentifier(true); - if (this.state.inGenerator && this.eat(tt.dot) && this.hasPlugin("functionSent")) { - return this.parseMetaProperty(node, meta, "sent"); - } else { - return this.parseFunction(node, false); + const node = this.startNodeAt(startPos, startLoc); + this.addExtra(node, "rawValue", value); + this.addExtra(node, "raw", this.input.slice(startPos, this.state.end)); + node.value = value; + this.next(); + return this.finishNode(node, type); } -}; -pp.parseMetaProperty = function (node, meta, propertyName) { - node.meta = meta; - node.property = this.parseIdentifier(true); - - if (node.property.name !== propertyName) { - this.raise(node.property.start, `The only valid meta property for new is ${meta.name}.${propertyName}`); + parseParenExpression() { + this.expect(tt.parenL); + const val = this.parseExpression(); + this.expect(tt.parenR); + return val; } - return this.finishNode(node, "MetaProperty"); -}; - -pp.parseLiteral = function (value, type, startPos, startLoc) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - - const node = this.startNodeAt(startPos, startLoc); - this.addExtra(node, "rawValue", value); - this.addExtra(node, "raw", this.input.slice(startPos, this.state.end)); - node.value = value; - this.next(); - return this.finishNode(node, type); -}; - -pp.parseParenExpression = function () { - this.expect(tt.parenL); - const val = this.parseExpression(); - this.expect(tt.parenR); - return val; -}; - -pp.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - - let val; - this.expect(tt.parenL); - - const innerStartPos = this.state.start; - const innerStartLoc = this.state.startLoc; - const exprList = []; - const refShorthandDefaultPos = { start: 0 }; - const refNeedsArrowPos = { start: 0 }; - let first = true; - let spreadStart; - let optionalCommaStart; - - while (!this.match(tt.parenR)) { - if (first) { - first = false; - } else { - this.expect(tt.comma, refNeedsArrowPos.start || null); - if (this.match(tt.parenR)) { - optionalCommaStart = this.state.start; + parseParenAndDistinguishExpression(startPos, startLoc, canBeArrow) { + startPos = startPos || this.state.start; + startLoc = startLoc || this.state.startLoc; + + let val; + this.expect(tt.parenL); + + const innerStartPos = this.state.start; + const innerStartLoc = this.state.startLoc; + const exprList = []; + const refShorthandDefaultPos = { start: 0 }; + const refNeedsArrowPos = { start: 0 }; + let first = true; + let spreadStart; + let optionalCommaStart; + + while (!this.match(tt.parenR)) { + if (first) { + first = false; + } else { + this.expect(tt.comma, refNeedsArrowPos.start || null); + if (this.match(tt.parenR)) { + optionalCommaStart = this.state.start; + break; + } + } + + if (this.match(tt.ellipsis)) { + const spreadNodeStartPos = this.state.start; + const spreadNodeStartLoc = this.state.startLoc; + spreadStart = this.state.start; + exprList.push(this.parseParenItem(this.parseRest(), spreadNodeStartPos, spreadNodeStartLoc)); break; + } else { + exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos)); } } - if (this.match(tt.ellipsis)) { - const spreadNodeStartPos = this.state.start; - const spreadNodeStartLoc = this.state.startLoc; - spreadStart = this.state.start; - exprList.push(this.parseParenItem(this.parseRest(), spreadNodeStartPos, spreadNodeStartLoc)); - break; - } else { - exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos)); - } - } + const innerEndPos = this.state.start; + const innerEndLoc = this.state.startLoc; + this.expect(tt.parenR); - const innerEndPos = this.state.start; - const innerEndLoc = this.state.startLoc; - this.expect(tt.parenR); + let arrowNode = this.startNodeAt(startPos, startLoc); + if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) { + for (const param of exprList) { + if (param.extra && param.extra.parenthesized) this.unexpected(param.extra.parenStart); + } - let arrowNode = this.startNodeAt(startPos, startLoc); - if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) { - for (const param of exprList) { - if (param.extra && param.extra.parenthesized) this.unexpected(param.extra.parenStart); + return this.parseArrowExpression(arrowNode, exprList); } - return this.parseArrowExpression(arrowNode, exprList); - } + if (!exprList.length) { + this.unexpected(this.state.lastTokStart); + } + if (optionalCommaStart) this.unexpected(optionalCommaStart); + if (spreadStart) this.unexpected(spreadStart); + if (refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start); + if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start); + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.toReferencedList(val.expressions); + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } - if (!exprList.length) { - this.unexpected(this.state.lastTokStart); - } - if (optionalCommaStart) this.unexpected(optionalCommaStart); - if (spreadStart) this.unexpected(spreadStart); - if (refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start); - if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start); - - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.toReferencedList(val.expressions); - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } + this.addExtra(val, "parenthesized", true); + this.addExtra(val, "parenStart", startPos); - this.addExtra(val, "parenthesized", true); - this.addExtra(val, "parenStart", startPos); + return val; + } - return val; -}; + shouldParseArrow() { + return !this.canInsertSemicolon(); + } -pp.shouldParseArrow = function () { - return !this.canInsertSemicolon(); -}; + parseArrow(node) { + if (this.eat(tt.arrow)) { + return node; + } + } -pp.parseArrow = function (node) { - if (this.eat(tt.arrow)) { + parseParenItem(node) { return node; } -}; -pp.parseParenItem = function (node) { - return node; -}; + // New's precedence is slightly tricky. It must allow its argument + // to be a `[]` or dot subscript expression, but not a call — at + // least, not without wrapping it in parentheses. Thus, it uses the -// New's precedence is slightly tricky. It must allow its argument -// to be a `[]` or dot subscript expression, but not a call — at -// least, not without wrapping it in parentheses. Thus, it uses the + parseNew() { + const node = this.startNode(); + const meta = this.parseIdentifier(true); -pp.parseNew = function () { - const node = this.startNode(); - const meta = this.parseIdentifier(true); + if (this.eat(tt.dot)) { + const metaProp = this.parseMetaProperty(node, meta, "target"); - if (this.eat(tt.dot)) { - const metaProp = this.parseMetaProperty(node, meta, "target"); + if (!this.state.inFunction) { + this.raise(metaProp.property.start, "new.target can only be used in functions"); + } - if (!this.state.inFunction) { - this.raise(metaProp.property.start, "new.target can only be used in functions"); + return metaProp; } - return metaProp; - } + node.callee = this.parseNoCallExpr(); - node.callee = this.parseNoCallExpr(); + if (this.eat(tt.parenL)) { + node.arguments = this.parseExprList(tt.parenR); + this.toReferencedList(node.arguments); + } else { + node.arguments = []; + } - if (this.eat(tt.parenL)) { - node.arguments = this.parseExprList(tt.parenR); - this.toReferencedList(node.arguments); - } else { - node.arguments = []; + return this.finishNode(node, "NewExpression"); } - return this.finishNode(node, "NewExpression"); -}; - -// Parse template expression. + // Parse template expression. -pp.parseTemplateElement = function (isTagged) { - const elem = this.startNode(); - if (this.state.value === null) { - if (!isTagged) { - this.raise(this.state.invalidTemplateEscapePosition, "Invalid escape sequence in template"); - } else { - this.state.invalidTemplateEscapePosition = null; + parseTemplateElement(isTagged) { + const elem = this.startNode(); + if (this.state.value === null) { + if (!isTagged) { + this.raise(this.state.invalidTemplateEscapePosition, "Invalid escape sequence in template"); + } else { + this.state.invalidTemplateEscapePosition = null; + } } + elem.value = { + raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), + cooked: this.state.value + }; + this.next(); + elem.tail = this.match(tt.backQuote); + return this.finishNode(elem, "TemplateElement"); } - elem.value = { - raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), - cooked: this.state.value - }; - this.next(); - elem.tail = this.match(tt.backQuote); - return this.finishNode(elem, "TemplateElement"); -}; - -pp.parseTemplate = function (isTagged) { - const node = this.startNode(); - this.next(); - node.expressions = []; - let curElt = this.parseTemplateElement(isTagged); - node.quasis = [curElt]; - while (!curElt.tail) { - this.expect(tt.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(tt.braceR); - node.quasis.push(curElt = this.parseTemplateElement(isTagged)); + + parseTemplate(isTagged) { + const node = this.startNode(); + this.next(); + node.expressions = []; + let curElt = this.parseTemplateElement(isTagged); + node.quasis = [curElt]; + while (!curElt.tail) { + this.expect(tt.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(tt.braceR); + node.quasis.push(curElt = this.parseTemplateElement(isTagged)); + } + this.next(); + return this.finishNode(node, "TemplateLiteral"); } - this.next(); - return this.finishNode(node, "TemplateLiteral"); -}; -// Parse an object literal or binding pattern. + // Parse an object literal or binding pattern. -pp.parseObj = function (isPattern, refShorthandDefaultPos) { - let decorators = []; - const propHash = Object.create(null); - let first = true; - const node = this.startNode(); + parseObj(isPattern, refShorthandDefaultPos) { + let decorators = []; + const propHash = Object.create(null); + let first = true; + const node = this.startNode(); - node.properties = []; - this.next(); + node.properties = []; + this.next(); - let firstRestLocation = null; + let firstRestLocation = null; - while (!this.eat(tt.braceR)) { - if (first) { - first = false; - } else { - this.expect(tt.comma); - if (this.eat(tt.braceR)) break; - } + while (!this.eat(tt.braceR)) { + if (first) { + first = false; + } else { + this.expect(tt.comma); + if (this.eat(tt.braceR)) break; + } - while (this.match(tt.at)) { - decorators.push(this.parseDecorator()); - } + while (this.match(tt.at)) { + decorators.push(this.parseDecorator()); + } - let prop = this.startNode(), isGenerator = false, isAsync = false, startPos, startLoc; - if (decorators.length) { - prop.decorators = decorators; - decorators = []; - } + let prop = this.startNode(), isGenerator = false, isAsync = false, startPos, startLoc; + if (decorators.length) { + prop.decorators = decorators; + decorators = []; + } - if (this.hasPlugin("objectRestSpread") && this.match(tt.ellipsis)) { - prop = this.parseSpread(isPattern ? { start: 0 } : undefined); - prop.type = isPattern ? "RestElement" : "SpreadElement"; - if (isPattern) this.toAssignable(prop.argument, true, "object pattern"); - node.properties.push(prop); - if (isPattern) { - const position = this.state.start; - if (firstRestLocation !== null) { - this.unexpected(firstRestLocation, "Cannot have multiple rest elements when destructuring"); - } else if (this.eat(tt.braceR)) { - break; - } else if (this.match(tt.comma) && this.lookahead().type === tt.braceR) { - this.unexpected(position, "A trailing comma is not permitted after the rest element"); + if (this.hasPlugin("objectRestSpread") && this.match(tt.ellipsis)) { + prop = this.parseSpread(isPattern ? { start: 0 } : undefined); + prop.type = isPattern ? "RestElement" : "SpreadElement"; + if (isPattern) this.toAssignable(prop.argument, true, "object pattern"); + node.properties.push(prop); + if (isPattern) { + const position = this.state.start; + if (firstRestLocation !== null) { + this.unexpected(firstRestLocation, "Cannot have multiple rest elements when destructuring"); + } else if (this.eat(tt.braceR)) { + break; + } else if (this.match(tt.comma) && this.lookahead().type === tt.braceR) { + this.unexpected(position, "A trailing comma is not permitted after the rest element"); + } else { + firstRestLocation = position; + continue; + } } else { - firstRestLocation = position; continue; } - } else { - continue; } - } - prop.method = false; - prop.shorthand = false; + prop.method = false; + prop.shorthand = false; - if (isPattern || refShorthandDefaultPos) { - startPos = this.state.start; - startLoc = this.state.startLoc; - } + if (isPattern || refShorthandDefaultPos) { + startPos = this.state.start; + startLoc = this.state.startLoc; + } - if (!isPattern) { - isGenerator = this.eat(tt.star); - } + if (!isPattern) { + isGenerator = this.eat(tt.star); + } - if (!isPattern && this.isContextual("async")) { - if (isGenerator) this.unexpected(); + if (!isPattern && this.isContextual("async")) { + if (isGenerator) this.unexpected(); - const asyncId = this.parseIdentifier(); - if (this.match(tt.colon) || this.match(tt.parenL) || this.match(tt.braceR) || this.match(tt.eq) || this.match(tt.comma)) { - prop.key = asyncId; - prop.computed = false; + const asyncId = this.parseIdentifier(); + if (this.match(tt.colon) || this.match(tt.parenL) || this.match(tt.braceR) || this.match(tt.eq) || this.match(tt.comma)) { + prop.key = asyncId; + prop.computed = false; + } else { + isAsync = true; + if (this.hasPlugin("asyncGenerators")) isGenerator = this.eat(tt.star); + this.parsePropertyName(prop); + } } else { - isAsync = true; - if (this.hasPlugin("asyncGenerators")) isGenerator = this.eat(tt.star); this.parsePropertyName(prop); } - } else { - this.parsePropertyName(prop); - } - this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos); - this.checkPropClash(prop, propHash); + this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos); + this.checkPropClash(prop, propHash); + + if (prop.shorthand) { + this.addExtra(prop, "shorthand", true); + } - if (prop.shorthand) { - this.addExtra(prop, "shorthand", true); + node.properties.push(prop); } - node.properties.push(prop); - } + if (firstRestLocation !== null) { + this.unexpected(firstRestLocation, "The rest element has to be the last element when destructuring"); + } + + if (decorators.length) { + this.raise(this.state.start, "You have trailing decorators with no property"); + } - if (firstRestLocation !== null) { - this.unexpected(firstRestLocation, "The rest element has to be the last element when destructuring"); + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); } - if (decorators.length) { - this.raise(this.state.start, "You have trailing decorators with no property"); + isGetterOrSetterMethod(prop, isPattern) { + return !isPattern && + !prop.computed && + prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + ( + this.match(tt.string) || // get "string"() {} + this.match(tt.num) || // get 1() {} + this.match(tt.bracketL) || // get ["string"]() {} + this.match(tt.name) || // get foo() {} + this.state.type.keyword // get debugger() {} + ); } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); -}; - -pp.isGetterOrSetterMethod = function (prop, isPattern) { - return !isPattern && - !prop.computed && - prop.key.type === "Identifier" && - (prop.key.name === "get" || prop.key.name === "set") && - ( - this.match(tt.string) || // get "string"() {} - this.match(tt.num) || // get 1() {} - this.match(tt.bracketL) || // get ["string"]() {} - this.match(tt.name) || // get foo() {} - this.state.type.keyword // get debugger() {} - ); -}; - -// get methods aren't allowed to have any parameters -// set methods must have exactly 1 parameter -pp.checkGetterSetterParamCount = function (method) { - const paramCount = method.kind === "get" ? 0 : 1; - if (method.params.length !== paramCount) { - const start = method.start; - if (method.kind === "get") { - this.raise(start, "getter should have no params"); - } else { - this.raise(start, "setter should have exactly one param"); + // get methods aren't allowed to have any parameters + // set methods must have exactly 1 parameter + checkGetterSetterParamCount(method) { + const paramCount = method.kind === "get" ? 0 : 1; + if (method.params.length !== paramCount) { + const start = method.start; + if (method.kind === "get") { + this.raise(start, "getter should have no params"); + } else { + this.raise(start, "setter should have exactly one param"); + } } } -}; -pp.parseObjectMethod = function (prop, isGenerator, isAsync, isPattern) { - if (isAsync || isGenerator || this.match(tt.parenL)) { - if (isPattern) this.unexpected(); - prop.kind = "method"; - prop.method = true; - this.parseMethod(prop, isGenerator, isAsync); + parseObjectMethod(prop, isGenerator, isAsync, isPattern) { + if (isAsync || isGenerator || this.match(tt.parenL)) { + if (isPattern) this.unexpected(); + prop.kind = "method"; + prop.method = true; + this.parseMethod(prop, isGenerator, isAsync); - return this.finishNode(prop, "ObjectMethod"); - } + return this.finishNode(prop, "ObjectMethod"); + } - if (this.isGetterOrSetterMethod(prop, isPattern)) { - if (isGenerator || isAsync) this.unexpected(); - prop.kind = prop.key.name; - this.parsePropertyName(prop); - this.parseMethod(prop); - this.checkGetterSetterParamCount(prop); + if (this.isGetterOrSetterMethod(prop, isPattern)) { + if (isGenerator || isAsync) this.unexpected(); + prop.kind = prop.key.name; + this.parsePropertyName(prop); + this.parseMethod(prop); + this.checkGetterSetterParamCount(prop); - return this.finishNode(prop, "ObjectMethod"); + return this.finishNode(prop, "ObjectMethod"); + } } -}; -pp.parseObjectProperty = function (prop, startPos, startLoc, isPattern, refShorthandDefaultPos) { - if (this.eat(tt.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos); + parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos) { + if (this.eat(tt.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos); - return this.finishNode(prop, "ObjectProperty"); - } + return this.finishNode(prop, "ObjectProperty"); + } - if (!prop.computed && prop.key.type === "Identifier") { - this.checkReservedWord(prop.key.name, prop.key.start, true, true); + if (!prop.computed && prop.key.type === "Identifier") { + this.checkReservedWord(prop.key.name, prop.key.start, true, true); - if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); - } else if (this.match(tt.eq) && refShorthandDefaultPos) { - if (!refShorthandDefaultPos.start) { - refShorthandDefaultPos.start = this.state.start; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); + } else if (this.match(tt.eq) && refShorthandDefaultPos) { + if (!refShorthandDefaultPos.start) { + refShorthandDefaultPos.start = this.state.start; + } + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); + } else { + prop.value = prop.key.__clone(); } - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); - } else { - prop.value = prop.key.__clone(); - } - prop.shorthand = true; + prop.shorthand = true; - return this.finishNode(prop, "ObjectProperty"); + return this.finishNode(prop, "ObjectProperty"); + } } -}; - -pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) { - const node = - this.parseObjectMethod(prop, isGenerator, isAsync, isPattern) || - this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos); - - if (!node) this.unexpected(); - - return node; -}; - -pp.parsePropertyName = function (prop) { - if (this.eat(tt.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(tt.bracketR); - } else { - prop.computed = false; - const oldInPropertyName = this.state.inPropertyName; - this.state.inPropertyName = true; - prop.key = (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); - this.state.inPropertyName = oldInPropertyName; + + parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) { + const node = + this.parseObjectMethod(prop, isGenerator, isAsync, isPattern) || + this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos); + + if (!node) this.unexpected(); + + return node; } - return prop.key; -}; - -// Initialize empty function node. - -pp.initFunction = function (node, isAsync) { - node.id = null; - node.generator = false; - node.expression = false; - node.async = !!isAsync; -}; - -// Parse object or class method. - -pp.parseMethod = function (node, isGenerator, isAsync) { - const oldInMethod = this.state.inMethod; - this.state.inMethod = node.kind || true; - this.initFunction(node, isAsync); - this.expect(tt.parenL); - node.params = this.parseBindingList(tt.parenR); - node.generator = !!isGenerator; - this.parseFunctionBody(node); - this.state.inMethod = oldInMethod; - return node; -}; - -// Parse arrow function expression with given parameters. - -pp.parseArrowExpression = function (node, params, isAsync) { - this.initFunction(node, isAsync); - node.params = this.toAssignableList(params, true, "arrow function parameters"); - this.parseFunctionBody(node, true); - return this.finishNode(node, "ArrowFunctionExpression"); -}; - -pp.isStrictBody = function (node, isExpression) { - if (!isExpression && node.body.directives.length) { - for (const directive of (node.body.directives: Array)) { - if (directive.value.value === "use strict") { - return true; - } + + parsePropertyName(prop) { + if (this.eat(tt.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(tt.bracketR); + } else { + prop.computed = false; + const oldInPropertyName = this.state.inPropertyName; + this.state.inPropertyName = true; + prop.key = (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); + this.state.inPropertyName = oldInPropertyName; } + return prop.key; } - return false; -}; - -// Parse function body and check parameters. -pp.parseFunctionBody = function (node, allowExpression) { - const isExpression = allowExpression && !this.match(tt.braceL); - - const oldInAsync = this.state.inAsync; - this.state.inAsync = node.async; - if (isExpression) { - node.body = this.parseMaybeAssign(); - node.expression = true; - } else { - // Start a new scope with regard to labels and the `inFunction` - // flag (restore them to their old value afterwards). - const oldInFunc = this.state.inFunction; - const oldInGen = this.state.inGenerator; - const oldLabels = this.state.labels; - this.state.inFunction = true; this.state.inGenerator = node.generator; this.state.labels = []; - node.body = this.parseBlock(true); + // Initialize empty function node. + + initFunction(node, isAsync) { + node.id = null; + node.generator = false; node.expression = false; - this.state.inFunction = oldInFunc; this.state.inGenerator = oldInGen; this.state.labels = oldLabels; + node.async = !!isAsync; + } + + // Parse object or class method. + + parseMethod(node, isGenerator, isAsync) { + const oldInMethod = this.state.inMethod; + this.state.inMethod = node.kind || true; + this.initFunction(node, isAsync); + this.expect(tt.parenL); + node.params = this.parseBindingList(tt.parenR); + node.generator = !!isGenerator; + this.parseFunctionBody(node); + this.state.inMethod = oldInMethod; + return node; } - this.state.inAsync = oldInAsync; - // If this is a strict mode function, verify that argument names - // are not repeated, and it does not try to bind the words `eval` - // or `arguments`. - const isStrict = this.isStrictBody(node, isExpression); - // Also check when allowExpression === true for arrow functions - const checkLVal = this.state.strict || allowExpression || isStrict; + // Parse arrow function expression with given parameters. - if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") { - this.raise(node.id.start, "Binding yield in strict mode"); + parseArrowExpression(node, params, isAsync) { + this.initFunction(node, isAsync); + node.params = this.toAssignableList(params, true, "arrow function parameters"); + this.parseFunctionBody(node, true); + return this.finishNode(node, "ArrowFunctionExpression"); } - if (checkLVal) { - const nameHash = Object.create(null); - const oldStrict = this.state.strict; - if (isStrict) this.state.strict = true; - if (node.id) { - this.checkLVal(node.id, true, undefined, "function name"); - } - for (const param of (node.params: Array)) { - if (isStrict && param.type !== "Identifier") { - this.raise(param.start, "Non-simple parameter in strict mode"); + isStrictBody(node, isExpression) { + if (!isExpression && node.body.directives.length) { + for (const directive of (node.body.directives: Array)) { + if (directive.value.value === "use strict") { + return true; + } } - this.checkLVal(param, true, nameHash, "function parameter list"); } - this.state.strict = oldStrict; - } -}; -// Parses a comma-separated list of expressions, and returns them as -// an array. `close` is the token type that ends the list, and -// `allowEmpty` can be turned on to allow subsequent commas with -// nothing in between them to be parsed as `null` (which is needed -// for array literals). + return false; + } -pp.parseExprList = function (close, allowEmpty, refShorthandDefaultPos) { - const elts = []; - let first = true; + // Parse function body and check parameters. + parseFunctionBody(node, allowExpression) { + const isExpression = allowExpression && !this.match(tt.braceL); - while (!this.eat(close)) { - if (first) { - first = false; + const oldInAsync = this.state.inAsync; + this.state.inAsync = node.async; + if (isExpression) { + node.body = this.parseMaybeAssign(); + node.expression = true; } else { - this.expect(tt.comma); - if (this.eat(close)) break; + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + const oldInFunc = this.state.inFunction; + const oldInGen = this.state.inGenerator; + const oldLabels = this.state.labels; + this.state.inFunction = true; this.state.inGenerator = node.generator; this.state.labels = []; + node.body = this.parseBlock(true); + node.expression = false; + this.state.inFunction = oldInFunc; this.state.inGenerator = oldInGen; this.state.labels = oldLabels; } + this.state.inAsync = oldInAsync; - elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); - } - return elts; -}; - -pp.parseExprListItem = function (allowEmpty, refShorthandDefaultPos, refNeedsArrowPos) { - let elt; - if (allowEmpty && this.match(tt.comma)) { - elt = null; - } else if (this.match(tt.ellipsis)) { - elt = this.parseSpread(refShorthandDefaultPos); - } else { - elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos); - } - return elt; -}; + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + const isStrict = this.isStrictBody(node, isExpression); + // Also check when allowExpression === true for arrow functions + const checkLVal = this.state.strict || allowExpression || isStrict; -// Parse the next token as an identifier. If `liberal` is true (used -// when parsing properties), it will also convert keywords into -// identifiers. + if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") { + this.raise(node.id.start, "Binding yield in strict mode"); + } -pp.parseIdentifier = function (liberal) { - const node = this.startNode(); - if (!liberal) { - this.checkReservedWord(this.state.value, this.state.start, !!this.state.type.keyword, false); + if (checkLVal) { + const nameHash = Object.create(null); + const oldStrict = this.state.strict; + if (isStrict) this.state.strict = true; + if (node.id) { + this.checkLVal(node.id, true, undefined, "function name"); + } + for (const param of (node.params: Array)) { + if (isStrict && param.type !== "Identifier") { + this.raise(param.start, "Non-simple parameter in strict mode"); + } + this.checkLVal(param, true, nameHash, "function parameter list"); + } + this.state.strict = oldStrict; + } } - if (this.match(tt.name)) { - node.name = this.state.value; - } else if (this.state.type.keyword) { - node.name = this.state.type.keyword; - } else { - this.unexpected(); + // Parses a comma-separated list of expressions, and returns them as + // an array. `close` is the token type that ends the list, and + // `allowEmpty` can be turned on to allow subsequent commas with + // nothing in between them to be parsed as `null` (which is needed + // for array literals). + + parseExprList(close, allowEmpty, refShorthandDefaultPos) { + const elts = []; + let first = true; + + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(tt.comma); + if (this.eat(close)) break; + } + + elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); + } + return elts; } - if (!liberal && node.name === "await" && this.state.inAsync) { - this.raise(node.start, "invalid use of await inside of an async function"); + parseExprListItem(allowEmpty, refShorthandDefaultPos, refNeedsArrowPos) { + let elt; + if (allowEmpty && this.match(tt.comma)) { + elt = null; + } else if (this.match(tt.ellipsis)) { + elt = this.parseSpread(refShorthandDefaultPos); + } else { + elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos); + } + return elt; } - node.loc.identifierName = node.name; + // Parse the next token as an identifier. If `liberal` is true (used + // when parsing properties), it will also convert keywords into + // identifiers. - this.next(); - return this.finishNode(node, "Identifier"); -}; + parseIdentifier(liberal) { + const node = this.startNode(); + if (!liberal) { + this.checkReservedWord(this.state.value, this.state.start, !!this.state.type.keyword, false); + } -pp.checkReservedWord = function (word, startLoc, checkKeywords, isBinding) { - if (this.isReservedWord(word) || (checkKeywords && this.isKeyword(word))) { - this.raise(startLoc, word + " is a reserved word"); - } + if (this.match(tt.name)) { + node.name = this.state.value; + } else if (this.state.type.keyword) { + node.name = this.state.type.keyword; + } else { + this.unexpected(); + } - if (this.state.strict && (reservedWords.strict(word) || (isBinding && reservedWords.strictBind(word)))) { - this.raise(startLoc, word + " is a reserved word in strict mode"); + if (!liberal && node.name === "await" && this.state.inAsync) { + this.raise(node.start, "invalid use of await inside of an async function"); + } + + node.loc.identifierName = node.name; + + this.next(); + return this.finishNode(node, "Identifier"); } -}; -// Parses await expression inside async function. + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (this.isReservedWord(word) || (checkKeywords && this.isKeyword(word))) { + this.raise(startLoc, word + " is a reserved word"); + } -pp.parseAwait = function (node) { - // istanbul ignore next: this condition is checked at the call site so won't be hit here - if (!this.state.inAsync) { - this.unexpected(); + if (this.state.strict && (reservedWords.strict(word) || (isBinding && reservedWords.strictBind(word)))) { + this.raise(startLoc, word + " is a reserved word in strict mode"); + } } - if (this.match(tt.star)) { - this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead."); + + // Parses await expression inside async function. + + parseAwait(node) { + // istanbul ignore next: this condition is checked at the call site so won't be hit here + if (!this.state.inAsync) { + this.unexpected(); + } + if (this.match(tt.star)) { + this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead."); + } + node.argument = this.parseMaybeUnary(); + return this.finishNode(node, "AwaitExpression"); } - node.argument = this.parseMaybeUnary(); - return this.finishNode(node, "AwaitExpression"); -}; - -// Parses yield expression inside generator. - -pp.parseYield = function () { - const node = this.startNode(); - this.next(); - if ( - this.match(tt.semi) || - this.canInsertSemicolon() || - (!this.match(tt.star) && !this.state.type.startsExpr) - ) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(tt.star); - node.argument = this.parseMaybeAssign(); + + // Parses yield expression inside generator. + + parseYield() { + const node = this.startNode(); + this.next(); + if ( + this.match(tt.semi) || + this.canInsertSemicolon() || + (!this.match(tt.star) && !this.state.type.startsExpr) + ) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(tt.star); + node.argument = this.parseMaybeAssign(); + } + return this.finishNode(node, "YieldExpression"); } - return this.finishNode(node, "YieldExpression"); -}; +} diff --git a/src/parser/index.js b/src/parser/index.js index 9600040c5f..41ce90fde2 100644 --- a/src/parser/index.js +++ b/src/parser/index.js @@ -1,11 +1,14 @@ -import { reservedWords } from "../util/identifier"; +// @flow + +import type { Options } from "../options"; +import type { File } from "../types"; import { getOptions } from "../options"; -import Tokenizer from "../tokenizer"; +import StatementParser from "./statement"; export const plugins = {}; -export default class Parser extends Tokenizer { - constructor(options: Object, input: string) { +export default class Parser extends StatementParser { + constructor(options: Options, input: string) { options = getOptions(options); super(options, input); @@ -21,25 +24,7 @@ export default class Parser extends Tokenizer { } } - isReservedWord(word: string): boolean { - if (word === "await") { - return this.inModule; - } else { - return reservedWords[6](word); - } - } - - hasPlugin(name: string): boolean { - return !!this.plugins[name]; - } - - parse(): { - type: "File", - program: { - type: "Program", - body: Array - } - } { + parse(): File { const file = this.startNode(); const program = this.startNode(); this.nextToken(); diff --git a/src/parser/location.js b/src/parser/location.js index 2a408a5100..1562f52fb6 100644 --- a/src/parser/location.js +++ b/src/parser/location.js @@ -1,7 +1,5 @@ import { getLineInfo } from "../util/location"; -import Parser from "./index"; - -const pp = Parser.prototype; +import CommentsParser from "./comments"; // This function is used to raise exceptions on parse errors. It // takes an offset integer (into the current `input`) to indicate @@ -9,11 +7,13 @@ const pp = Parser.prototype; // of the error message, and then raises a `SyntaxError` with that // message. -pp.raise = function (pos, message) { - const loc = getLineInfo(this.input, pos); - message += ` (${loc.line}:${loc.column})`; - const err = new SyntaxError(message); - err.pos = pos; - err.loc = loc; - throw err; -}; +export default class LocationParser extends CommentsParser { + raise(pos, message) { + const loc = getLineInfo(this.input, pos); + message += ` (${loc.line}:${loc.column})`; + const err = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + throw err; + } +} diff --git a/src/parser/lval.js b/src/parser/lval.js index 9f0f7566c7..b3d33baf3d 100644 --- a/src/parser/lval.js +++ b/src/parser/lval.js @@ -1,259 +1,260 @@ import { types as tt } from "../tokenizer/types"; -import Parser from "./index"; - -const pp = Parser.prototype; - -// Convert existing expression atom to assignable pattern -// if possible. - -pp.toAssignable = function (node, isBinding, contextDescription) { - if (node) { - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - break; - - case "ObjectExpression": - node.type = "ObjectPattern"; - for (const prop of (node.properties: Array)) { - if (prop.type === "ObjectMethod") { - if (prop.kind === "get" || prop.kind === "set") { - this.raise(prop.key.start, "Object pattern can't contain getter or setter"); +import { NodeUtils } from "./node"; + +export default class LValParser extends NodeUtils { + // Convert existing expression atom to assignable pattern + // if possible. + + toAssignable(node, isBinding, contextDescription) { + if (node) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + break; + + case "ObjectExpression": + node.type = "ObjectPattern"; + for (const prop of (node.properties: Array)) { + if (prop.type === "ObjectMethod") { + if (prop.kind === "get" || prop.kind === "set") { + this.raise(prop.key.start, "Object pattern can't contain getter or setter"); + } else { + this.raise(prop.key.start, "Object pattern can't contain methods"); + } } else { - this.raise(prop.key.start, "Object pattern can't contain methods"); + this.toAssignable(prop, isBinding, "object destructuring pattern"); } - } else { - this.toAssignable(prop, isBinding, "object destructuring pattern"); } - } - break; + break; - case "ObjectProperty": - this.toAssignable(node.value, isBinding, contextDescription); - break; + case "ObjectProperty": + this.toAssignable(node.value, isBinding, contextDescription); + break; - case "SpreadElement": - node.type = "RestElement"; - break; + case "SpreadElement": + node.type = "RestElement"; + break; - case "ArrayExpression": - node.type = "ArrayPattern"; - this.toAssignableList(node.elements, isBinding, contextDescription); - break; + case "ArrayExpression": + node.type = "ArrayPattern"; + this.toAssignableList(node.elements, isBinding, contextDescription); + break; - case "AssignmentExpression": - if (node.operator === "=") { - node.type = "AssignmentPattern"; - delete node.operator; - } else { - this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); - } - break; + case "AssignmentExpression": + if (node.operator === "=") { + node.type = "AssignmentPattern"; + delete node.operator; + } else { + this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + } + break; - case "MemberExpression": - if (!isBinding) break; + case "MemberExpression": + if (!isBinding) break; - default: { - const message = "Invalid left-hand side" + - (contextDescription ? " in " + contextDescription : /* istanbul ignore next */ "expression"); - this.raise(node.start, message); + default: { + const message = "Invalid left-hand side" + + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */ "expression"); + this.raise(node.start, message); + } } } + return node; } - return node; -}; - -// Convert list of expression atoms to binding list. - -pp.toAssignableList = function (exprList, isBinding, contextDescription) { - let end = exprList.length; - if (end) { - const last = exprList[end - 1]; - if (last && last.type === "RestElement") { - --end; - } else if (last && last.type === "SpreadElement") { - last.type = "RestElement"; - const arg = last.argument; - this.toAssignable(arg, isBinding, contextDescription); - if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") { - this.unexpected(arg.start); + + // Convert list of expression atoms to binding list. + + toAssignableList(exprList, isBinding, contextDescription) { + let end = exprList.length; + if (end) { + const last = exprList[end - 1]; + if (last && last.type === "RestElement") { + --end; + } else if (last && last.type === "SpreadElement") { + last.type = "RestElement"; + const arg = last.argument; + this.toAssignable(arg, isBinding, contextDescription); + if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") { + this.unexpected(arg.start); + } + --end; } - --end; } + for (let i = 0; i < end; i++) { + const elt = exprList[i]; + if (elt && elt.type === "SpreadElement") + this.raise(elt.start, "The rest element has to be the last element when destructuring"); + if (elt) this.toAssignable(elt, isBinding, contextDescription); + } + return exprList; } - for (let i = 0; i < end; i++) { - const elt = exprList[i]; - if (elt && elt.type === "SpreadElement") - this.raise(elt.start, "The rest element has to be the last element when destructuring"); - if (elt) this.toAssignable(elt, isBinding, contextDescription); + + // Convert list of expression atoms to a list of + + toReferencedList(exprList) { + return exprList; } - return exprList; -}; - -// Convert list of expression atoms to a list of - -pp.toReferencedList = function (exprList) { - return exprList; -}; - -// Parses spread element. - -pp.parseSpread = function (refShorthandDefaultPos) { - const node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos); - return this.finishNode(node, "SpreadElement"); -}; - -pp.parseRest = function () { - const node = this.startNode(); - this.next(); - node.argument = this.parseBindingAtom(); - return this.finishNode(node, "RestElement"); -}; - -pp.shouldAllowYieldIdentifier = function () { - return this.match(tt._yield) && !this.state.strict && !this.state.inGenerator; -}; - -pp.parseBindingIdentifier = function () { - return this.parseIdentifier(this.shouldAllowYieldIdentifier()); -}; - -// Parses lvalue (assignable) atom. -pp.parseBindingAtom = function () { - switch (this.state.type) { - case tt._yield: - case tt.name: - return this.parseBindingIdentifier(); - - case tt.bracketL: - const node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(tt.bracketR, true); - return this.finishNode(node, "ArrayPattern"); - - case tt.braceL: - return this.parseObj(true); - - default: - this.unexpected(); + + // Parses spread element. + + parseSpread(refShorthandDefaultPos) { + const node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos); + return this.finishNode(node, "SpreadElement"); + } + + parseRest() { + const node = this.startNode(); + this.next(); + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); + } + + shouldAllowYieldIdentifier() { + return this.match(tt._yield) && !this.state.strict && !this.state.inGenerator; } -}; - -pp.parseBindingList = function (close, allowEmpty) { - const elts = []; - let first = true; - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(tt.comma); + + parseBindingIdentifier() { + return this.parseIdentifier(this.shouldAllowYieldIdentifier()); + } + + // Parses lvalue (assignable) atom. + parseBindingAtom() { + switch (this.state.type) { + case tt._yield: + case tt.name: + return this.parseBindingIdentifier(); + + case tt.bracketL: + const node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(tt.bracketR, true); + return this.finishNode(node, "ArrayPattern"); + + case tt.braceL: + return this.parseObj(true); + + default: + this.unexpected(); } - if (allowEmpty && this.match(tt.comma)) { - elts.push(null); - } else if (this.eat(close)) { - break; - } else if (this.match(tt.ellipsis)) { - elts.push(this.parseAssignableListItemTypes(this.parseRest())); - this.expect(close); - break; - } else { - const decorators = []; - while (this.match(tt.at)) { - decorators.push(this.parseDecorator()); + } + + parseBindingList(close, allowEmpty) { + const elts = []; + let first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(tt.comma); } - const left = this.parseMaybeDefault(); - if (decorators.length) { - left.decorators = decorators; + if (allowEmpty && this.match(tt.comma)) { + elts.push(null); + } else if (this.eat(close)) { + break; + } else if (this.match(tt.ellipsis)) { + elts.push(this.parseAssignableListItemTypes(this.parseRest())); + this.expect(close); + break; + } else { + const decorators = []; + while (this.match(tt.at)) { + decorators.push(this.parseDecorator()); + } + const left = this.parseMaybeDefault(); + if (decorators.length) { + left.decorators = decorators; + } + this.parseAssignableListItemTypes(left); + elts.push(this.parseMaybeDefault(left.start, left.loc.start, left)); } - this.parseAssignableListItemTypes(left); - elts.push(this.parseMaybeDefault(left.start, left.loc.start, left)); } + return elts; + } + + parseAssignableListItemTypes(param) { + return param; } - return elts; -}; - -pp.parseAssignableListItemTypes = function (param) { - return param; -}; - -// Parses assignment pattern around given atom if possible. - -pp.parseMaybeDefault = function (startPos, startLoc, left) { - startLoc = startLoc || this.state.startLoc; - startPos = startPos || this.state.start; - left = left || this.parseBindingAtom(); - if (!this.eat(tt.eq)) return left; - - const node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssign(); - return this.finishNode(node, "AssignmentPattern"); -}; - -// Verify that a node is an lval — something that can be assigned -// to. - -pp.checkLVal = function (expr, isBinding, checkClashes, contextDescription) { - switch (expr.type) { - case "Identifier": - this.checkReservedWord(expr.name, expr.start, false, true); - - if (checkClashes) { - // we need to prefix this with an underscore for the cases where we have a key of - // `__proto__`. there's a bug in old V8 where the following wouldn't work: - // - // > var obj = Object.create(null); - // undefined - // > obj.__proto__ - // null - // > obj.__proto__ = true; - // true - // > obj.__proto__ - // null - const key = `_${expr.name}`; - - if (checkClashes[key]) { - this.raise(expr.start, "Argument name clash in strict mode"); - } else { - checkClashes[key] = true; + + // Parses assignment pattern around given atom if possible. + + parseMaybeDefault(startPos, startLoc, left) { + startLoc = startLoc || this.state.startLoc; + startPos = startPos || this.state.start; + left = left || this.parseBindingAtom(); + if (!this.eat(tt.eq)) return left; + + const node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern"); + } + + // Verify that a node is an lval — something that can be assigned + // to. + + checkLVal(expr, isBinding, checkClashes, contextDescription) { + switch (expr.type) { + case "Identifier": + this.checkReservedWord(expr.name, expr.start, false, true); + + if (checkClashes) { + // we need to prefix this with an underscore for the cases where we have a key of + // `__proto__`. there's a bug in old V8 where the following wouldn't work: + // + // > var obj = Object.create(null); + // undefined + // > obj.__proto__ + // null + // > obj.__proto__ = true; + // true + // > obj.__proto__ + // null + const key = `_${expr.name}`; + + if (checkClashes[key]) { + this.raise(expr.start, "Argument name clash in strict mode"); + } else { + checkClashes[key] = true; + } } - } - break; + break; - case "MemberExpression": - if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); - break; + case "MemberExpression": + if (isBinding) + this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); + break; - case "ObjectPattern": - for (let prop of (expr.properties: Array)) { - if (prop.type === "ObjectProperty") prop = prop.value; - this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern"); - } - break; + case "ObjectPattern": + for (let prop of (expr.properties: Array)) { + if (prop.type === "ObjectProperty") prop = prop.value; + this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern"); + } + break; - case "ArrayPattern": - for (const elem of (expr.elements: Array)) { - if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern"); - } - break; + case "ArrayPattern": + for (const elem of (expr.elements: Array)) { + if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern"); + } + break; - case "AssignmentPattern": - this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern"); - break; + case "AssignmentPattern": + this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern"); + break; - case "RestElement": - this.checkLVal(expr.argument, isBinding, checkClashes, "rest element"); - break; + case "RestElement": + this.checkLVal(expr.argument, isBinding, checkClashes, "rest element"); + break; - default: { - const message = (isBinding ? /* istanbul ignore next */ "Binding invalid" : "Invalid") + - " left-hand side" + - (contextDescription ? " in " + contextDescription : /* istanbul ignore next */ "expression"); - this.raise(expr.start, message); + default: { + const message = (isBinding ? /* istanbul ignore next */ "Binding invalid" : "Invalid") + + " left-hand side" + + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */ "expression"); + this.raise(expr.start, message); + } } } -}; +} diff --git a/src/parser/node.js b/src/parser/node.js index 364323ec7f..dafe10af9b 100644 --- a/src/parser/node.js +++ b/src/parser/node.js @@ -1,9 +1,9 @@ import Parser from "./index"; +import UtilParser from "./util"; import { SourceLocation, type Position } from "../util/location"; // Start an AST node, attaching a start offset. -const pp = Parser.prototype; const commentKeys = ["leadingComments", "trailingComments", "innerComments"]; class Node { @@ -34,43 +34,40 @@ class Node { } } -pp.startNode = function () { - return new Node(this, this.state.start, this.state.startLoc); -}; - -pp.startNodeAt = function (pos, loc) { - return new Node(this, pos, loc); -}; - -function finishNodeAt(node, type, pos, loc) { - node.type = type; - node.end = pos; - node.loc.end = loc; - if (this.options.ranges) node.range[1] = pos; - this.processComment(node); - return node; -} +export class NodeUtils extends UtilParser { + startNode() { + return new Node(this, this.state.start, this.state.startLoc); + } -// Finish an AST node, adding `type` and `end` properties. + startNodeAt(pos, loc) { + return new Node(this, pos, loc); + } -pp.finishNode = function (node, type) { - return finishNodeAt.call(this, node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); -}; + // Finish an AST node, adding `type` and `end` properties. -// Finish node at given position + finishNode(node, type) { + return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); + } -pp.finishNodeAt = function (node, type, pos, loc) { - return finishNodeAt.call(this, node, type, pos, loc); -}; + // Finish node at given position + finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + node.loc.end = loc; + if (this.options.ranges) node.range[1] = pos; + this.processComment(node); + return node; + } -/** - * Reset the start location of node to the start location of locationNode - */ -pp.resetStartLocationFromNode = function (node, locationNode) { - node.start = locationNode.start; - node.loc.start = locationNode.loc.start; - if (this.options.ranges) node.range[0] = locationNode.range[0]; + /** + * Reset the start location of node to the start location of locationNode + */ + resetStartLocationFromNode(node, locationNode) { + node.start = locationNode.start; + node.loc.start = locationNode.loc.start; + if (this.options.ranges) node.range[0] = locationNode.range[0]; - return node; -}; + return node; + } +} diff --git a/src/parser/statement.js b/src/parser/statement.js index f4bd38fb2f..376c685147 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -1,257 +1,277 @@ /* eslint max-len: 0 */ import { types as tt } from "../tokenizer/types"; -import Parser from "./index"; +import ExpressionParser from "./expression"; import { lineBreak } from "../util/whitespace"; -const pp = Parser.prototype; +// Reused empty array added for node fields that are always empty. -// ### Statement parsing +const empty = []; -// Parse a program. Initializes the parser, reads any number of -// statements, and wraps them in a Program node. Optionally takes a -// `program` argument. If present, the statements will be appended -// to its body instead of creating a new node. +const loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" }; -pp.parseTopLevel = function (file, program) { - program.sourceType = this.options.sourceType; +export default class StatementParser extends ExpressionParser { - this.parseBlockBody(program, true, true, tt.eof); + // ### Statement parsing - file.program = this.finishNode(program, "Program"); - file.comments = this.state.comments; - file.tokens = this.state.tokens; + // Parse a program. Initializes the parser, reads any number of + // statements, and wraps them in a Program node. Optionally takes a + // `program` argument. If present, the statements will be appended + // to its body instead of creating a new node. - return this.finishNode(file, "File"); -}; + parseTopLevel(file, program) { + program.sourceType = this.options.sourceType; -const loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" }; + this.parseBlockBody(program, true, true, tt.eof); -// TODO + file.program = this.finishNode(program, "Program"); + file.comments = this.state.comments; + file.tokens = this.state.tokens; -pp.stmtToDirective = function (stmt) { - const expr = stmt.expression; + return this.finishNode(file, "File"); + } - const directiveLiteral = this.startNodeAt(expr.start, expr.loc.start); - const directive = this.startNodeAt(stmt.start, stmt.loc.start); + // TODO - const raw = this.input.slice(expr.start, expr.end); - const val = directiveLiteral.value = raw.slice(1, -1); // remove quotes + stmtToDirective(stmt) { + const expr = stmt.expression; - this.addExtra(directiveLiteral, "raw", raw); - this.addExtra(directiveLiteral, "rawValue", val); + const directiveLiteral = this.startNodeAt(expr.start, expr.loc.start); + const directive = this.startNodeAt(stmt.start, stmt.loc.start); - directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end); + const raw = this.input.slice(expr.start, expr.end); + const val = directiveLiteral.value = raw.slice(1, -1); // remove quotes - return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end); -}; + this.addExtra(directiveLiteral, "raw", raw); + this.addExtra(directiveLiteral, "rawValue", val); -// Parse a single statement. -// -// If expecting a statement and finding a slash operator, parse a -// regular expression literal. This is to handle cases like -// `if (foo) /blah/.exec(foo)`, where looking at the previous token -// does not help. + directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end); -pp.parseStatement = function (declaration, topLevel) { - if (this.match(tt.at)) { - this.parseDecorators(true); + return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end); } - const starttype = this.state.type; - const node = this.startNode(); - - // Most types of statements are recognized by the keyword they - // start with. Many are trivial to parse, some require a bit of - // complexity. - - switch (starttype) { - case tt._break: case tt._continue: return this.parseBreakContinueStatement(node, starttype.keyword); - case tt._debugger: return this.parseDebuggerStatement(node); - case tt._do: return this.parseDoStatement(node); - case tt._for: return this.parseForStatement(node); - case tt._function: - if (!declaration) this.unexpected(); - return this.parseFunctionStatement(node); - - case tt._class: - if (!declaration) this.unexpected(); - return this.parseClass(node, true); - - case tt._if: return this.parseIfStatement(node); - case tt._return: return this.parseReturnStatement(node); - case tt._switch: return this.parseSwitchStatement(node); - case tt._throw: return this.parseThrowStatement(node); - case tt._try: return this.parseTryStatement(node); - - case tt._let: - case tt._const: - if (!declaration) this.unexpected(); // NOTE: falls through to _var - - case tt._var: - return this.parseVarStatement(node, starttype); - - case tt._while: return this.parseWhileStatement(node); - case tt._with: return this.parseWithStatement(node); - case tt.braceL: return this.parseBlock(); - case tt.semi: return this.parseEmptyStatement(node); - case tt._export: - case tt._import: - if (this.hasPlugin("dynamicImport") && this.lookahead().type === tt.parenL) break; - - if (!this.options.allowImportExportEverywhere) { - if (!topLevel) { - this.raise(this.state.start, "'import' and 'export' may only appear at the top level"); - } + // Parse a single statement. + // + // If expecting a statement and finding a slash operator, parse a + // regular expression literal. This is to handle cases like + // `if (foo) /blah/.exec(foo)`, where looking at the previous token + // does not help. - if (!this.inModule) { - this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'"); - } - } - return starttype === tt._import ? this.parseImport(node) : this.parseExport(node); + parseStatement(declaration, topLevel) { + if (this.match(tt.at)) { + this.parseDecorators(true); + } - case tt.name: - if (this.state.value === "async") { - // peek ahead and see if next token is a function - const state = this.state.clone(); - this.next(); - if (this.match(tt._function) && !this.canInsertSemicolon()) { - this.expect(tt._function); - return this.parseFunction(node, true, false, true); - } else { - this.state = state; + const starttype = this.state.type; + const node = this.startNode(); + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case tt._break: case tt._continue: return this.parseBreakContinueStatement(node, starttype.keyword); + case tt._debugger: return this.parseDebuggerStatement(node); + case tt._do: return this.parseDoStatement(node); + case tt._for: return this.parseForStatement(node); + case tt._function: + if (!declaration) this.unexpected(); + return this.parseFunctionStatement(node); + + case tt._class: + if (!declaration) this.unexpected(); + return this.parseClass(node, true); + + case tt._if: return this.parseIfStatement(node); + case tt._return: return this.parseReturnStatement(node); + case tt._switch: return this.parseSwitchStatement(node); + case tt._throw: return this.parseThrowStatement(node); + case tt._try: return this.parseTryStatement(node); + + case tt._let: + case tt._const: + if (!declaration) this.unexpected(); // NOTE: falls through to _var + + case tt._var: + return this.parseVarStatement(node, starttype); + + case tt._while: return this.parseWhileStatement(node); + case tt._with: return this.parseWithStatement(node); + case tt.braceL: return this.parseBlock(); + case tt.semi: return this.parseEmptyStatement(node); + case tt._export: + case tt._import: + if (this.hasPlugin("dynamicImport") && this.lookahead().type === tt.parenL) break; + + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) { + this.raise(this.state.start, "'import' and 'export' may only appear at the top level"); + } + + if (!this.inModule) { + this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'"); + } } - } - } + return starttype === tt._import ? this.parseImport(node) : this.parseExport(node); + + case tt.name: + if (this.state.value === "async") { + // peek ahead and see if next token is a function + const state = this.state.clone(); + this.next(); + if (this.match(tt._function) && !this.canInsertSemicolon()) { + this.expect(tt._function); + return this.parseFunction(node, true, false, true); + } else { + this.state = state; + } + } + } - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - const maybeName = this.state.value; - const expr = this.parseExpression(); - - if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) { - return this.parseLabeledStatement(node, maybeName, expr); - } else { - return this.parseExpressionStatement(node, expr); - } -}; + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + const maybeName = this.state.value; + const expr = this.parseExpression(); -pp.takeDecorators = function (node) { - if (this.state.decorators.length) { - node.decorators = this.state.decorators; - this.state.decorators = []; + if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) { + return this.parseLabeledStatement(node, maybeName, expr); + } else { + return this.parseExpressionStatement(node, expr); + } } -}; -pp.parseDecorators = function (allowExport) { - while (this.match(tt.at)) { - const decorator = this.parseDecorator(); - this.state.decorators.push(decorator); + takeDecorators(node) { + if (this.state.decorators.length) { + node.decorators = this.state.decorators; + this.state.decorators = []; + } } - if (allowExport && this.match(tt._export)) { - return; - } + parseDecorators(allowExport) { + while (this.match(tt.at)) { + const decorator = this.parseDecorator(); + this.state.decorators.push(decorator); + } - if (!this.match(tt._class)) { - this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); - } -}; + if (allowExport && this.match(tt._export)) { + return; + } -pp.parseDecorator = function () { - if (!this.hasPlugin("decorators")) { - this.unexpected(); - } - const node = this.startNode(); - this.next(); - node.expression = this.parseMaybeAssign(); - return this.finishNode(node, "Decorator"); -}; - -pp.parseBreakContinueStatement = function (node, keyword) { - const isBreak = keyword === "break"; - this.next(); - - if (this.isLineTerminator()) { - node.label = null; - } else if (!this.match(tt.name)) { - this.unexpected(); - } else { - node.label = this.parseIdentifier(); - this.semicolon(); + if (!this.match(tt._class)) { + this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); + } } - // Verify that there is an actual destination to break or - // continue to. - let i; - for (i = 0; i < this.state.labels.length; ++i) { - const lab = this.state.labels[i]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) break; - if (node.label && isBreak) break; + parseDecorator() { + if (!this.hasPlugin("decorators")) { + this.unexpected(); } - } - if (i === this.state.labels.length) this.raise(node.start, "Unsyntactic " + keyword); - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); -}; - -pp.parseDebuggerStatement = function (node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement"); -}; - -pp.parseDoStatement = function (node) { - this.next(); - this.state.labels.push(loopLabel); - node.body = this.parseStatement(false); - this.state.labels.pop(); - this.expect(tt._while); - node.test = this.parseParenExpression(); - this.eat(tt.semi); - return this.finishNode(node, "DoWhileStatement"); -}; - -// Disambiguating between a `for` and a `for`/`in` or `for`/`of` -// loop is non-trivial. Basically, we have to parse the init `var` -// statement or expression, disallowing the `in` operator (see -// the second parameter to `parseExpression`), and then check -// whether the next token is `in` or `of`. When there is no init -// part (semicolon immediately after the opening parenthesis), it -// is a regular `for` loop. - -pp.parseForStatement = function (node) { - this.next(); - this.state.labels.push(loopLabel); - - let forAwait = false; - if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) { - forAwait = true; + const node = this.startNode(); this.next(); + node.expression = this.parseMaybeAssign(); + return this.finishNode(node, "Decorator"); } - this.expect(tt.parenL); - if (this.match(tt.semi)) { - if (forAwait) { + parseBreakContinueStatement(node, keyword) { + const isBreak = keyword === "break"; + this.next(); + + if (this.isLineTerminator()) { + node.label = null; + } else if (!this.match(tt.name)) { this.unexpected(); + } else { + node.label = this.parseIdentifier(); + this.semicolon(); } - return this.parseFor(node, null); + + // Verify that there is an actual destination to break or + // continue to. + let i; + for (i = 0; i < this.state.labels.length; ++i) { + const lab = this.state.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) break; + if (node.label && isBreak) break; + } + } + if (i === this.state.labels.length) this.raise(node.start, "Unsyntactic " + keyword); + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); + } + + parseDebuggerStatement(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); } - if (this.match(tt._var) || this.match(tt._let) || this.match(tt._const)) { - const init = this.startNode(); - const varKind = this.state.type; + parseDoStatement(node) { this.next(); - this.parseVar(init, true, varKind); - this.finishNode(init, "VariableDeclaration"); + this.state.labels.push(loopLabel); + node.body = this.parseStatement(false); + this.state.labels.pop(); + this.expect(tt._while); + node.test = this.parseParenExpression(); + this.eat(tt.semi); + return this.finishNode(node, "DoWhileStatement"); + } - if (this.match(tt._in) || this.isContextual("of")) { - if (init.declarations.length === 1 && !init.declarations[0].init) { - return this.parseForIn(node, init, forAwait); + // Disambiguating between a `for` and a `for`/`in` or `for`/`of` + // loop is non-trivial. Basically, we have to parse the init `var` + // statement or expression, disallowing the `in` operator (see + // the second parameter to `parseExpression`), and then check + // whether the next token is `in` or `of`. When there is no init + // part (semicolon immediately after the opening parenthesis), it + // is a regular `for` loop. + + parseForStatement(node) { + this.next(); + this.state.labels.push(loopLabel); + + let forAwait = false; + if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) { + forAwait = true; + this.next(); + } + this.expect(tt.parenL); + + if (this.match(tt.semi)) { + if (forAwait) { + this.unexpected(); + } + return this.parseFor(node, null); + } + + if (this.match(tt._var) || this.match(tt._let) || this.match(tt._const)) { + const init = this.startNode(); + const varKind = this.state.type; + this.next(); + this.parseVar(init, true, varKind); + this.finishNode(init, "VariableDeclaration"); + + if (this.match(tt._in) || this.isContextual("of")) { + if (init.declarations.length === 1 && !init.declarations[0].init) { + return this.parseForIn(node, init, forAwait); + } } + if (forAwait) { + this.unexpected(); + } + return this.parseFor(node, init); + } + + const refShorthandDefaultPos = { start: 0 }; + const init = this.parseExpression(true, refShorthandDefaultPos); + if (this.match(tt._in) || this.isContextual("of")) { + const description = this.isContextual("of") ? "for-of statement" : "for-in statement"; + this.toAssignable(init, undefined, description); + this.checkLVal(init, undefined, undefined, description); + return this.parseForIn(node, init, forAwait); + } else if (refShorthandDefaultPos.start) { + this.unexpected(refShorthandDefaultPos.start); } if (forAwait) { this.unexpected(); @@ -259,847 +279,828 @@ pp.parseForStatement = function (node) { return this.parseFor(node, init); } - const refShorthandDefaultPos = { start: 0 }; - const init = this.parseExpression(true, refShorthandDefaultPos); - if (this.match(tt._in) || this.isContextual("of")) { - const description = this.isContextual("of") ? "for-of statement" : "for-in statement"; - this.toAssignable(init, undefined, description); - this.checkLVal(init, undefined, undefined, description); - return this.parseForIn(node, init, forAwait); - } else if (refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - if (forAwait) { - this.unexpected(); + parseFunctionStatement(node) { + this.next(); + return this.parseFunction(node, true); } - return this.parseFor(node, init); -}; - -pp.parseFunctionStatement = function (node) { - this.next(); - return this.parseFunction(node, true); -}; - -pp.parseIfStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - node.consequent = this.parseStatement(false); - node.alternate = this.eat(tt._else) ? this.parseStatement(false) : null; - return this.finishNode(node, "IfStatement"); -}; - -pp.parseReturnStatement = function (node) { - if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) { - this.raise(this.state.start, "'return' outside of function"); + + parseIfStatement(node) { + this.next(); + node.test = this.parseParenExpression(); + node.consequent = this.parseStatement(false); + node.alternate = this.eat(tt._else) ? this.parseStatement(false) : null; + return this.finishNode(node, "IfStatement"); } - this.next(); + parseReturnStatement(node) { + if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) { + this.raise(this.state.start, "'return' outside of function"); + } - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. + this.next(); - if (this.isLineTerminator()) { - node.argument = null; - } else { - node.argument = this.parseExpression(); - this.semicolon(); - } + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. - return this.finishNode(node, "ReturnStatement"); -}; - -pp.parseSwitchStatement = function (node) { - this.next(); - node.discriminant = this.parseParenExpression(); - node.cases = []; - this.expect(tt.braceL); - this.state.labels.push(switchLabel); - - // Statements under must be grouped (by label) in SwitchCase - // nodes. `cur` is used to keep the node that we are currently - // adding statements to. - - let cur; - for (let sawDefault; !this.match(tt.braceR); ) { - if (this.match(tt._case) || this.match(tt._default)) { - const isCase = this.match(tt._case); - if (cur) this.finishNode(cur, "SwitchCase"); - node.cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) this.raise(this.state.lastTokStart, "Multiple default clauses"); - sawDefault = true; - cur.test = null; - } - this.expect(tt.colon); + if (this.isLineTerminator()) { + node.argument = null; } else { - if (cur) { - cur.consequent.push(this.parseStatement(true)); + node.argument = this.parseExpression(); + this.semicolon(); + } + + return this.finishNode(node, "ReturnStatement"); + } + + parseSwitchStatement(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(tt.braceL); + this.state.labels.push(switchLabel); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + let cur; + for (let sawDefault; !this.match(tt.braceR); ) { + if (this.match(tt._case) || this.match(tt._default)) { + const isCase = this.match(tt._case); + if (cur) this.finishNode(cur, "SwitchCase"); + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) this.raise(this.state.lastTokStart, "Multiple default clauses"); + sawDefault = true; + cur.test = null; + } + this.expect(tt.colon); } else { - this.unexpected(); + if (cur) { + cur.consequent.push(this.parseStatement(true)); + } else { + this.unexpected(); + } } } + if (cur) this.finishNode(cur, "SwitchCase"); + this.next(); // Closing brace + this.state.labels.pop(); + return this.finishNode(node, "SwitchStatement"); } - if (cur) this.finishNode(cur, "SwitchCase"); - this.next(); // Closing brace - this.state.labels.pop(); - return this.finishNode(node, "SwitchStatement"); -}; - -pp.parseThrowStatement = function (node) { - this.next(); - if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) - this.raise(this.state.lastTokEnd, "Illegal newline after throw"); - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement"); -}; -// Reused empty array added for node fields that are always empty. + parseThrowStatement(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) + this.raise(this.state.lastTokEnd, "Illegal newline after throw"); + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); + } -const empty = []; + parseTryStatement(node) { + this.next(); -pp.parseTryStatement = function (node) { - this.next(); + node.block = this.parseBlock(); + node.handler = null; - node.block = this.parseBlock(); - node.handler = null; + if (this.match(tt._catch)) { + const clause = this.startNode(); + this.next(); - if (this.match(tt._catch)) { - const clause = this.startNode(); - this.next(); + this.expect(tt.parenL); + clause.param = this.parseBindingAtom(); + this.checkLVal(clause.param, true, Object.create(null), "catch clause"); + this.expect(tt.parenR); - this.expect(tt.parenL); - clause.param = this.parseBindingAtom(); - this.checkLVal(clause.param, true, Object.create(null), "catch clause"); - this.expect(tt.parenR); + clause.body = this.parseBlock(); + node.handler = this.finishNode(clause, "CatchClause"); + } + + node.guardedHandlers = empty; + node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null; - clause.body = this.parseBlock(); - node.handler = this.finishNode(clause, "CatchClause"); + if (!node.handler && !node.finalizer) { + this.raise(node.start, "Missing catch or finally clause"); + } + + return this.finishNode(node, "TryStatement"); } - node.guardedHandlers = empty; - node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null; + parseVarStatement(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); + } - if (!node.handler && !node.finalizer) { - this.raise(node.start, "Missing catch or finally clause"); + parseWhileStatement(node) { + this.next(); + node.test = this.parseParenExpression(); + this.state.labels.push(loopLabel); + node.body = this.parseStatement(false); + this.state.labels.pop(); + return this.finishNode(node, "WhileStatement"); } - return this.finishNode(node, "TryStatement"); -}; - -pp.parseVarStatement = function (node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); -}; - -pp.parseWhileStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - this.state.labels.push(loopLabel); - node.body = this.parseStatement(false); - this.state.labels.pop(); - return this.finishNode(node, "WhileStatement"); -}; - -pp.parseWithStatement = function (node) { - if (this.state.strict) this.raise(this.state.start, "'with' in strict mode"); - this.next(); - node.object = this.parseParenExpression(); - node.body = this.parseStatement(false); - return this.finishNode(node, "WithStatement"); -}; - -pp.parseEmptyStatement = function (node) { - this.next(); - return this.finishNode(node, "EmptyStatement"); -}; - -pp.parseLabeledStatement = function (node, maybeName, expr) { - for (const label of (this.state.labels: Array)) { - if (label.name === maybeName) { - this.raise(expr.start, `Label '${maybeName}' is already declared`); - } + parseWithStatement(node) { + if (this.state.strict) this.raise(this.state.start, "'with' in strict mode"); + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement(false); + return this.finishNode(node, "WithStatement"); } - const kind = this.state.type.isLoop ? "loop" : this.match(tt._switch) ? "switch" : null; - for (let i = this.state.labels.length - 1; i >= 0; i--) { - const label = this.state.labels[i]; - if (label.statementStart === node.start) { - label.statementStart = this.state.start; - label.kind = kind; - } else { - break; - } + parseEmptyStatement(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); } - this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start }); - node.body = this.parseStatement(true); - this.state.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement"); -}; - -pp.parseExpressionStatement = function (node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement"); -}; - -// Parse a semicolon-enclosed block of statements, handling `"use -// strict"` declarations when `allowStrict` is true (used for -// function bodies). - -pp.parseBlock = function (allowDirectives?) { - const node = this.startNode(); - this.expect(tt.braceL); - this.parseBlockBody(node, allowDirectives, false, tt.braceR); - return this.finishNode(node, "BlockStatement"); -}; - -pp.isValidDirective = function (stmt) { - return stmt.type === "ExpressionStatement" && - stmt.expression.type === "StringLiteral" && - !stmt.expression.extra.parenthesized; -}; - -pp.parseBlockBody = function (node, allowDirectives, topLevel, end) { - node.body = []; - node.directives = []; - - let parsedNonDirective = false; - let oldStrict; - let octalPosition; - - while (!this.eat(end)) { - if (!parsedNonDirective && this.state.containsOctal && !octalPosition) { - octalPosition = this.state.octalPosition; + parseLabeledStatement(node, maybeName, expr) { + for (const label of (this.state.labels: Array)) { + if (label.name === maybeName) { + this.raise(expr.start, `Label '${maybeName}' is already declared`); + } } - const stmt = this.parseStatement(true, topLevel); + const kind = this.state.type.isLoop ? "loop" : this.match(tt._switch) ? "switch" : null; + for (let i = this.state.labels.length - 1; i >= 0; i--) { + const label = this.state.labels[i]; + if (label.statementStart === node.start) { + label.statementStart = this.state.start; + label.kind = kind; + } else { + break; + } + } + + this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start }); + node.body = this.parseStatement(true); + this.state.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); + } + + parseExpressionStatement(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); + } + + // Parse a semicolon-enclosed block of statements, handling `"use + // strict"` declarations when `allowStrict` is true (used for + // function bodies). + + parseBlock(allowDirectives?) { + const node = this.startNode(); + this.expect(tt.braceL); + this.parseBlockBody(node, allowDirectives, false, tt.braceR); + return this.finishNode(node, "BlockStatement"); + } + + isValidDirective(stmt) { + return stmt.type === "ExpressionStatement" && + stmt.expression.type === "StringLiteral" && + !stmt.expression.extra.parenthesized; + } + + parseBlockBody(node, allowDirectives, topLevel, end) { + node.body = []; + node.directives = []; + + let parsedNonDirective = false; + let oldStrict; + let octalPosition; + + while (!this.eat(end)) { + if (!parsedNonDirective && this.state.containsOctal && !octalPosition) { + octalPosition = this.state.octalPosition; + } + + const stmt = this.parseStatement(true, topLevel); - if (allowDirectives && !parsedNonDirective && this.isValidDirective(stmt)) { - const directive = this.stmtToDirective(stmt); - node.directives.push(directive); + if (allowDirectives && !parsedNonDirective && this.isValidDirective(stmt)) { + const directive = this.stmtToDirective(stmt); + node.directives.push(directive); - if (oldStrict === undefined && directive.value.value === "use strict") { - oldStrict = this.state.strict; - this.setStrict(true); + if (oldStrict === undefined && directive.value.value === "use strict") { + oldStrict = this.state.strict; + this.setStrict(true); - if (octalPosition) { - this.raise(octalPosition, "Octal literal in strict mode"); + if (octalPosition) { + this.raise(octalPosition, "Octal literal in strict mode"); + } } + + continue; } - continue; + parsedNonDirective = true; + node.body.push(stmt); } - parsedNonDirective = true; - node.body.push(stmt); - } - - if (oldStrict === false) { - this.setStrict(false); - } -}; - -// Parse a regular `for` loop. The disambiguation code in -// `parseStatement` will already have parsed the init statement or -// expression. - -pp.parseFor = function (node, init) { - node.init = init; - this.expect(tt.semi); - node.test = this.match(tt.semi) ? null : this.parseExpression(); - this.expect(tt.semi); - node.update = this.match(tt.parenR) ? null : this.parseExpression(); - this.expect(tt.parenR); - node.body = this.parseStatement(false); - this.state.labels.pop(); - return this.finishNode(node, "ForStatement"); -}; - -// Parse a `for`/`in` and `for`/`of` loop, which are almost -// same from parser's perspective. - -pp.parseForIn = function (node, init, forAwait) { - const type = this.match(tt._in) ? "ForInStatement" : "ForOfStatement"; - if (forAwait) { - this.eatContextual("of"); - } else { - this.next(); - } - node.await = !!forAwait; - node.left = init; - node.right = this.parseExpression(); - this.expect(tt.parenR); - node.body = this.parseStatement(false); - this.state.labels.pop(); - return this.finishNode(node, type); -}; - -// Parse a list of variable declarations. - -pp.parseVar = function (node, isFor, kind) { - node.declarations = []; - node.kind = kind.keyword; - for (;;) { - const decl = this.startNode(); - this.parseVarHead(decl); - if (this.eat(tt.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if (kind === tt._const && !(this.match(tt._in) || this.isContextual("of"))) { - this.unexpected(); - } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(tt._in) || this.isContextual("of")))) { - this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value"); - } else { - decl.init = null; + if (oldStrict === false) { + this.setStrict(false); } - node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(tt.comma)) break; } - return node; -}; -pp.parseVarHead = function (decl) { - decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, true, undefined, "variable declaration"); -}; + // Parse a regular `for` loop. The disambiguation code in + // `parseStatement` will already have parsed the init statement or + // expression. -// Parse a function declaration or literal (depending on the -// `isStatement` parameter). - -pp.parseFunction = function (node, isStatement, allowExpressionBody, isAsync, optionalId) { - const oldInMethod = this.state.inMethod; - this.state.inMethod = false; + parseFor(node, init) { + node.init = init; + this.expect(tt.semi); + node.test = this.match(tt.semi) ? null : this.parseExpression(); + this.expect(tt.semi); + node.update = this.match(tt.parenR) ? null : this.parseExpression(); + this.expect(tt.parenR); + node.body = this.parseStatement(false); + this.state.labels.pop(); + return this.finishNode(node, "ForStatement"); + } - this.initFunction(node, isAsync); + // Parse a `for`/`in` and `for`/`of` loop, which are almost + // same from parser's perspective. - if (this.match(tt.star)) { - if (node.async && !this.hasPlugin("asyncGenerators")) { - this.unexpected(); + parseForIn(node, init, forAwait) { + const type = this.match(tt._in) ? "ForInStatement" : "ForOfStatement"; + if (forAwait) { + this.eatContextual("of"); } else { - node.generator = true; this.next(); } + node.await = !!forAwait; + node.left = init; + node.right = this.parseExpression(); + this.expect(tt.parenR); + node.body = this.parseStatement(false); + this.state.labels.pop(); + return this.finishNode(node, type); } - if (isStatement && !optionalId && !this.match(tt.name) && !this.match(tt._yield)) { - this.unexpected(); + // Parse a list of variable declarations. + + parseVar(node, isFor, kind) { + node.declarations = []; + node.kind = kind.keyword; + for (;;) { + const decl = this.startNode(); + this.parseVarHead(decl); + if (this.eat(tt.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === tt._const && !(this.match(tt._in) || this.isContextual("of"))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(tt._in) || this.isContextual("of")))) { + this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(tt.comma)) break; + } + return node; } - if (this.match(tt.name) || this.match(tt._yield)) { - node.id = this.parseBindingIdentifier(); + parseVarHead(decl) { + decl.id = this.parseBindingAtom(); + this.checkLVal(decl.id, true, undefined, "variable declaration"); } - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody); + // Parse a function declaration or literal (depending on the + // `isStatement` parameter). - this.state.inMethod = oldInMethod; + parseFunction(node, isStatement, allowExpressionBody, isAsync, optionalId) { + const oldInMethod = this.state.inMethod; + this.state.inMethod = false; - return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); -}; + this.initFunction(node, isAsync); -pp.parseFunctionParams = function (node) { - this.expect(tt.parenL); - node.params = this.parseBindingList(tt.parenR); -}; + if (this.match(tt.star)) { + if (node.async && !this.hasPlugin("asyncGenerators")) { + this.unexpected(); + } else { + node.generator = true; + this.next(); + } + } -// Parse a class declaration or literal (depending on the -// `isStatement` parameter). + if (isStatement && !optionalId && !this.match(tt.name) && !this.match(tt._yield)) { + this.unexpected(); + } -pp.parseClass = function (node, isStatement, optionalId) { - this.next(); - this.takeDecorators(node); - this.parseClassId(node, isStatement, optionalId); - this.parseClassSuper(node); - this.parseClassBody(node); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); -}; + if (this.match(tt.name) || this.match(tt._yield)) { + node.id = this.parseBindingIdentifier(); + } -pp.isClassProperty = function () { - return this.match(tt.eq) || this.match(tt.semi) || this.match(tt.braceR); -}; + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody); -pp.isClassMethod = function () { - return this.match(tt.parenL); -}; + this.state.inMethod = oldInMethod; -pp.isNonstaticConstructor = function (method) { - return !method.computed && !method.static && ( - (method.key.name === "constructor") || // Identifier - (method.key.value === "constructor") // Literal - ); -}; + return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); + } -pp.parseClassBody = function (node) { - // class bodies are implicitly strict - const oldStrict = this.state.strict; - this.state.strict = true; + parseFunctionParams(node) { + this.expect(tt.parenL); + node.params = this.parseBindingList(tt.parenR); + } - let hadConstructor = false; - let decorators = []; - const classBody = this.startNode(); + // Parse a class declaration or literal (depending on the + // `isStatement` parameter). - classBody.body = []; + parseClass(node, isStatement, optionalId) { + this.next(); + this.takeDecorators(node); + this.parseClassId(node, isStatement, optionalId); + this.parseClassSuper(node); + this.parseClassBody(node); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + } - this.expect(tt.braceL); + isClassProperty() { + return this.match(tt.eq) || this.match(tt.semi) || this.match(tt.braceR); + } - while (!this.eat(tt.braceR)) { - if (this.eat(tt.semi)) { - if (decorators.length > 0) { - this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon"); - } - continue; - } + isClassMethod() { + return this.match(tt.parenL); + } - if (this.match(tt.at)) { - decorators.push(this.parseDecorator()); - continue; - } + isNonstaticConstructor(method) { + return !method.computed && !method.static && ( + (method.key.name === "constructor") || // Identifier + (method.key.value === "constructor") // Literal + ); + } - const method = this.startNode(); + parseClassBody(node) { + // class bodies are implicitly strict + const oldStrict = this.state.strict; + this.state.strict = true; - // steal the decorators if there are any - if (decorators.length) { - method.decorators = decorators; - decorators = []; - } + let hadConstructor = false; + let decorators = []; + const classBody = this.startNode(); - method.static = false; - if (this.match(tt.name) && this.state.value === "static") { - const key = this.parseIdentifier(true); // eats 'static' - if (this.isClassMethod()) { - // a method named 'static' - method.kind = "method"; - method.computed = false; - method.key = key; - this.parseClassMethod(classBody, method, false, false); - continue; - } else if (this.isClassProperty()) { - // a property named 'static' - method.computed = false; - method.key = key; - classBody.body.push(this.parseClassProperty(method)); + classBody.body = []; + + this.expect(tt.braceL); + + while (!this.eat(tt.braceR)) { + if (this.eat(tt.semi)) { + if (decorators.length > 0) { + this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon"); + } continue; } - // otherwise something static - method.static = true; - } - if (this.eat(tt.star)) { - // a generator - method.kind = "method"; - this.parsePropertyName(method); - if (this.isNonstaticConstructor(method)) { - this.raise(method.key.start, "Constructor can't be a generator"); - } - if (!method.computed && method.static && (method.key.name === "prototype" || method.key.value === "prototype")) { - this.raise(method.key.start, "Classes may not have static property named prototype"); + if (this.match(tt.at)) { + decorators.push(this.parseDecorator()); + continue; } - this.parseClassMethod(classBody, method, true, false); - } else { - const isSimple = this.match(tt.name); - const key = this.parsePropertyName(method); - if (!method.computed && method.static && (method.key.name === "prototype" || method.key.value === "prototype")) { - this.raise(method.key.start, "Classes may not have static property named prototype"); + + const method = this.startNode(); + + // steal the decorators if there are any + if (decorators.length) { + method.decorators = decorators; + decorators = []; } - if (this.isClassMethod()) { - // a normal method - if (this.isNonstaticConstructor(method)) { - if (hadConstructor) { - this.raise(key.start, "Duplicate constructor in the same class"); - } else if (method.decorators) { - this.raise(method.start, "You can't attach decorators to a class constructor"); - } - hadConstructor = true; - method.kind = "constructor"; - } else { + + method.static = false; + if (this.match(tt.name) && this.state.value === "static") { + const key = this.parseIdentifier(true); // eats 'static' + if (this.isClassMethod()) { + // a method named 'static' method.kind = "method"; + method.computed = false; + method.key = key; + this.parseClassMethod(classBody, method, false, false); + continue; + } else if (this.isClassProperty()) { + // a property named 'static' + method.computed = false; + method.key = key; + classBody.body.push(this.parseClassProperty(method)); + continue; } - this.parseClassMethod(classBody, method, false, false); - } else if (this.isClassProperty()) { - // a normal property - if (this.isNonstaticConstructor(method)) { - this.raise(method.key.start, "Classes may not have a non-static field named 'constructor'"); - } - classBody.body.push(this.parseClassProperty(method)); - } else if (isSimple && key.name === "async" && !this.isLineTerminator()) { - // an async method - const isGenerator = this.hasPlugin("asyncGenerators") && this.eat(tt.star); + // otherwise something static + method.static = true; + } + + if (this.eat(tt.star)) { + // a generator method.kind = "method"; this.parsePropertyName(method); if (this.isNonstaticConstructor(method)) { - this.raise(method.key.start, "Constructor can't be an async function"); - } - this.parseClassMethod(classBody, method, isGenerator, true); - } else if (isSimple && (key.name === "get" || key.name === "set") && !(this.isLineTerminator() && this.match(tt.star))) { // `get\n*` is an uninitialized property named 'get' followed by a generator. - // a getter or setter - method.kind = key.name; - this.parsePropertyName(method); - if (this.isNonstaticConstructor(method)) { - this.raise(method.key.start, "Constructor can't have get/set modifier"); + this.raise(method.key.start, "Constructor can't be a generator"); } - this.parseClassMethod(classBody, method, false, false); - this.checkGetterSetterParamCount(method); - } else if (this.isLineTerminator()) { - // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token) - if (this.isNonstaticConstructor(method)) { - this.raise(method.key.start, "Classes may not have a non-static field named 'constructor'"); + if (!method.computed && method.static && (method.key.name === "prototype" || method.key.value === "prototype")) { + this.raise(method.key.start, "Classes may not have static property named prototype"); } - classBody.body.push(this.parseClassProperty(method)); + this.parseClassMethod(classBody, method, true, false); } else { - this.unexpected(); + const isSimple = this.match(tt.name); + const key = this.parsePropertyName(method); + if (!method.computed && method.static && (method.key.name === "prototype" || method.key.value === "prototype")) { + this.raise(method.key.start, "Classes may not have static property named prototype"); + } + if (this.isClassMethod()) { + // a normal method + if (this.isNonstaticConstructor(method)) { + if (hadConstructor) { + this.raise(key.start, "Duplicate constructor in the same class"); + } else if (method.decorators) { + this.raise(method.start, "You can't attach decorators to a class constructor"); + } + hadConstructor = true; + method.kind = "constructor"; + } else { + method.kind = "method"; + } + this.parseClassMethod(classBody, method, false, false); + } else if (this.isClassProperty()) { + // a normal property + if (this.isNonstaticConstructor(method)) { + this.raise(method.key.start, "Classes may not have a non-static field named 'constructor'"); + } + classBody.body.push(this.parseClassProperty(method)); + } else if (isSimple && key.name === "async" && !this.isLineTerminator()) { + // an async method + const isGenerator = this.hasPlugin("asyncGenerators") && this.eat(tt.star); + method.kind = "method"; + this.parsePropertyName(method); + if (this.isNonstaticConstructor(method)) { + this.raise(method.key.start, "Constructor can't be an async function"); + } + this.parseClassMethod(classBody, method, isGenerator, true); + } else if (isSimple && (key.name === "get" || key.name === "set") && !(this.isLineTerminator() && this.match(tt.star))) { // `get\n*` is an uninitialized property named 'get' followed by a generator. + // a getter or setter + method.kind = key.name; + this.parsePropertyName(method); + if (this.isNonstaticConstructor(method)) { + this.raise(method.key.start, "Constructor can't have get/set modifier"); + } + this.parseClassMethod(classBody, method, false, false); + this.checkGetterSetterParamCount(method); + } else if (this.isLineTerminator()) { + // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token) + if (this.isNonstaticConstructor(method)) { + this.raise(method.key.start, "Classes may not have a non-static field named 'constructor'"); + } + classBody.body.push(this.parseClassProperty(method)); + } else { + this.unexpected(); + } } } - } - if (decorators.length) { - this.raise(this.state.start, "You have trailing decorators with no method"); - } + if (decorators.length) { + this.raise(this.state.start, "You have trailing decorators with no method"); + } - node.body = this.finishNode(classBody, "ClassBody"); + node.body = this.finishNode(classBody, "ClassBody"); - this.state.strict = oldStrict; -}; + this.state.strict = oldStrict; + } + + parseClassProperty(node) { + const noPluginMsg = "You can only use Class Properties when the 'classProperties' plugin is enabled."; + if (!node.typeAnnotation && !this.hasPlugin("classProperties")) { + this.raise(node.start, noPluginMsg); + } -pp.parseClassProperty = function (node) { - const noPluginMsg = "You can only use Class Properties when the 'classProperties' plugin is enabled."; - if (!node.typeAnnotation && !this.hasPlugin("classProperties")) { - this.raise(node.start, noPluginMsg); + if (this.match(tt.eq)) { + if (!this.hasPlugin("classProperties")) this.raise(this.state.start, noPluginMsg); + this.next(); + node.value = this.parseMaybeAssign(); + } else { + node.value = null; + } + this.semicolon(); + return this.finishNode(node, "ClassProperty"); } - if (this.match(tt.eq)) { - if (!this.hasPlugin("classProperties")) this.raise(this.state.start, noPluginMsg); - this.next(); - node.value = this.parseMaybeAssign(); - } else { - node.value = null; + parseClassMethod(classBody, method, isGenerator, isAsync) { + this.parseMethod(method, isGenerator, isAsync); + classBody.body.push(this.finishNode(method, "ClassMethod")); } - this.semicolon(); - return this.finishNode(node, "ClassProperty"); -}; - -pp.parseClassMethod = function (classBody, method, isGenerator, isAsync) { - this.parseMethod(method, isGenerator, isAsync); - classBody.body.push(this.finishNode(method, "ClassMethod")); -}; - -pp.parseClassId = function (node, isStatement, optionalId) { - if (this.match(tt.name)) { - node.id = this.parseIdentifier(); - } else { - if (optionalId || !isStatement) { - node.id = null; + + parseClassId(node, isStatement, optionalId) { + if (this.match(tt.name)) { + node.id = this.parseIdentifier(); } else { - this.unexpected(); + if (optionalId || !isStatement) { + node.id = null; + } else { + this.unexpected(); + } } } -}; -pp.parseClassSuper = function (node) { - node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null; -}; + parseClassSuper(node) { + node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null; + } -// Parses module export declaration. + // Parses module export declaration. -pp.parseExport = function (node) { - this.eat(tt._export); + parseExport(node) { + this.eat(tt._export); - // export * from '...' - if (this.match(tt.star)) { - const specifier = this.startNode(); - this.next(); - if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) { + // export * from '...' + if (this.match(tt.star)) { + const specifier = this.startNode(); + this.next(); + if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) { + specifier.exported = this.parseIdentifier(true); + node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")]; + this.parseExportSpecifiersMaybe(node); + this.parseExportFrom(node, true); + } else { + this.parseExportFrom(node, true); + return this.finishNode(node, "ExportAllDeclaration"); + } + } else if (this.hasPlugin("exportExtensions") && this.isExportDefaultSpecifier()) { + const specifier = this.startNode(); specifier.exported = this.parseIdentifier(true); - node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")]; - this.parseExportSpecifiersMaybe(node); - this.parseExportFrom(node, true); - } else { + node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; + if (this.match(tt.comma) && this.lookahead().type === tt.star) { + this.expect(tt.comma); + const specifier = this.startNode(); + this.expect(tt.star); + this.expectContextual("as"); + specifier.exported = this.parseIdentifier(); + node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); + } else { + this.parseExportSpecifiersMaybe(node); + } this.parseExportFrom(node, true); - return this.finishNode(node, "ExportAllDeclaration"); - } - } else if (this.hasPlugin("exportExtensions") && this.isExportDefaultSpecifier()) { - const specifier = this.startNode(); - specifier.exported = this.parseIdentifier(true); - node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; - if (this.match(tt.comma) && this.lookahead().type === tt.star) { - this.expect(tt.comma); - const specifier = this.startNode(); - this.expect(tt.star); - this.expectContextual("as"); - specifier.exported = this.parseIdentifier(); - node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); - } else { - this.parseExportSpecifiersMaybe(node); - } - this.parseExportFrom(node, true); - } else if (this.eat(tt._default)) { // export default ... - let expr = this.startNode(); - let needsSemi = false; - if (this.eat(tt._function)) { - expr = this.parseFunction(expr, true, false, false, true); - } else if ( - this.isContextual("async") && - this.lookahead().type === tt._function - ) { // async function declaration - this.eatContextual("async"); - this.eat(tt._function); - expr = this.parseFunction(expr, true, false, true, true); - } else if (this.match(tt._class)) { - expr = this.parseClass(expr, true, true); - } else { - needsSemi = true; - expr = this.parseMaybeAssign(); + } else if (this.eat(tt._default)) { // export default ... + let expr = this.startNode(); + let needsSemi = false; + if (this.eat(tt._function)) { + expr = this.parseFunction(expr, true, false, false, true); + } else if ( + this.isContextual("async") && + this.lookahead().type === tt._function + ) { // async function declaration + this.eatContextual("async"); + this.eat(tt._function); + expr = this.parseFunction(expr, true, false, true, true); + } else if (this.match(tt._class)) { + expr = this.parseClass(expr, true, true); + } else { + needsSemi = true; + expr = this.parseMaybeAssign(); + } + node.declaration = expr; + if (needsSemi) this.semicolon(); + this.checkExport(node, true, true); + return this.finishNode(node, "ExportDefaultDeclaration"); + } else if (this.shouldParseExportDeclaration()) { + node.specifiers = []; + node.source = null; + node.declaration = this.parseExportDeclaration(node); + } else { // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(); + this.parseExportFrom(node); } - node.declaration = expr; - if (needsSemi) this.semicolon(); - this.checkExport(node, true, true); - return this.finishNode(node, "ExportDefaultDeclaration"); - } else if (this.shouldParseExportDeclaration()) { - node.specifiers = []; - node.source = null; - node.declaration = this.parseExportDeclaration(node); - } else { // export { x, y as z } [from '...'] - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(); - this.parseExportFrom(node); - } - this.checkExport(node, true); - return this.finishNode(node, "ExportNamedDeclaration"); -}; - -pp.parseExportDeclaration = function () { - return this.parseStatement(true); -}; - -pp.isExportDefaultSpecifier = function () { - if (this.match(tt.name)) { - return this.state.value !== "type" - && this.state.value !== "async" - && this.state.value !== "interface"; + this.checkExport(node, true); + return this.finishNode(node, "ExportNamedDeclaration"); } - if (!this.match(tt._default)) { - return false; + parseExportDeclaration() { + return this.parseStatement(true); } - const lookahead = this.lookahead(); - return lookahead.type === tt.comma || (lookahead.type === tt.name && lookahead.value === "from"); -}; + isExportDefaultSpecifier() { + if (this.match(tt.name)) { + return this.state.value !== "type" + && this.state.value !== "async" + && this.state.value !== "interface"; + } -pp.parseExportSpecifiersMaybe = function (node) { - if (this.eat(tt.comma)) { - node.specifiers = node.specifiers.concat(this.parseExportSpecifiers()); + if (!this.match(tt._default)) { + return false; + } + + const lookahead = this.lookahead(); + return lookahead.type === tt.comma || (lookahead.type === tt.name && lookahead.value === "from"); } -}; - -pp.parseExportFrom = function (node, expect?) { - if (this.eatContextual("from")) { - node.source = this.match(tt.string) ? this.parseExprAtom() : this.unexpected(); - this.checkExport(node); - } else { - if (expect) { - this.unexpected(); - } else { - node.source = null; + + parseExportSpecifiersMaybe(node) { + if (this.eat(tt.comma)) { + node.specifiers = node.specifiers.concat(this.parseExportSpecifiers()); } } - this.semicolon(); -}; - -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) { - if (checkNames) { - // Check for duplicate exports - if (isDefault) { - // Default exports - this.checkDuplicateExports(node, "default"); - } else if (node.specifiers && node.specifiers.length) { - // Named exports - for (const specifier of node.specifiers) { - this.checkDuplicateExports(specifier, specifier.exported.name); + parseExportFrom(node, expect?) { + if (this.eatContextual("from")) { + node.source = this.match(tt.string) ? this.parseExprAtom() : this.unexpected(); + this.checkExport(node); + } else { + if (expect) { + this.unexpected(); + } else { + node.source = null; } - } else if (node.declaration) { - // Exported declarations - if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") { - this.checkDuplicateExports(node, node.declaration.id.name); - } else if (node.declaration.type === "VariableDeclaration") { - for (const declaration of node.declaration.declarations) { - this.checkDeclaration(declaration.id); + } + + this.semicolon(); + } + + shouldParseExportDeclaration(): 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"); + } + + checkExport(node, checkNames, isDefault) { + if (checkNames) { + // Check for duplicate exports + if (isDefault) { + // Default exports + this.checkDuplicateExports(node, "default"); + } else if (node.specifiers && node.specifiers.length) { + // Named exports + for (const specifier of node.specifiers) { + this.checkDuplicateExports(specifier, specifier.exported.name); + } + } else if (node.declaration) { + // Exported declarations + if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") { + this.checkDuplicateExports(node, node.declaration.id.name); + } else if (node.declaration.type === "VariableDeclaration") { + for (const declaration of node.declaration.declarations) { + this.checkDeclaration(declaration.id); + } } } } - } - if (this.state.decorators.length) { - const isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression"); - if (!node.declaration || !isClass) { - this.raise(node.start, "You can only use decorators on an export when exporting a class"); + if (this.state.decorators.length) { + const isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression"); + if (!node.declaration || !isClass) { + this.raise(node.start, "You can only use decorators on an export when exporting a class"); + } + this.takeDecorators(node.declaration); } - this.takeDecorators(node.declaration); } -}; -pp.checkDeclaration = function(node) { - if (node.type === "ObjectPattern") { - for (const prop of node.properties) { - this.checkDeclaration(prop); - } - } else if (node.type === "ArrayPattern") { - for (const elem of node.elements) { - if (elem) { - this.checkDeclaration(elem); + checkDeclaration(node) { + if (node.type === "ObjectPattern") { + for (const prop of node.properties) { + this.checkDeclaration(prop); } + } else if (node.type === "ArrayPattern") { + for (const elem of node.elements) { + if (elem) { + this.checkDeclaration(elem); + } + } + } else if (node.type === "ObjectProperty") { + this.checkDeclaration(node.value); + } else if (node.type === "RestElement") { + this.checkDeclaration(node.argument); + } else if (node.type === "Identifier") { + this.checkDuplicateExports(node, node.name); + } + } + + checkDuplicateExports(node, name) { + if (this.state.exportedIdentifiers.indexOf(name) > -1) { + this.raiseDuplicateExportError(node, name); } - } else if (node.type === "ObjectProperty") { - this.checkDeclaration(node.value); - } else if (node.type === "RestElement") { - this.checkDeclaration(node.argument); - } else if (node.type === "Identifier") { - this.checkDuplicateExports(node, node.name); + this.state.exportedIdentifiers.push(name); } -}; -pp.checkDuplicateExports = function(node, name) { - if (this.state.exportedIdentifiers.indexOf(name) > -1) { - this.raiseDuplicateExportError(node, name); + raiseDuplicateExportError(node, name) { + this.raise(node.start, name === "default" ? + "Only one default export allowed per module." : + `\`${name}\` has already been exported. Exported identifiers must be unique.` + ); } - this.state.exportedIdentifiers.push(name); -}; -pp.raiseDuplicateExportError = function(node, name) { - this.raise(node.start, name === "default" ? - "Only one default export allowed per module." : - `\`${name}\` has already been exported. Exported identifiers must be unique.` - ); -}; + // Parses a comma-separated list of module exports. -// Parses a comma-separated list of module exports. + parseExportSpecifiers() { + const nodes = []; + let first = true; + let needsFrom; -pp.parseExportSpecifiers = function () { - const nodes = []; - let first = true; - let needsFrom; + // export { x, y as z } [from '...'] + this.expect(tt.braceL); - // export { x, y as z } [from '...'] - this.expect(tt.braceL); + while (!this.eat(tt.braceR)) { + if (first) { + first = false; + } else { + this.expect(tt.comma); + if (this.eat(tt.braceR)) break; + } - while (!this.eat(tt.braceR)) { - if (first) { - first = false; - } else { - this.expect(tt.comma); - if (this.eat(tt.braceR)) break; + const isDefault = this.match(tt._default); + if (isDefault && !needsFrom) needsFrom = true; + + const node = this.startNode(); + node.local = this.parseIdentifier(isDefault); + node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone(); + nodes.push(this.finishNode(node, "ExportSpecifier")); } - const isDefault = this.match(tt._default); - if (isDefault && !needsFrom) needsFrom = true; + // https://github.com/ember-cli/ember-cli/pull/3739 + if (needsFrom && !this.isContextual("from")) { + this.unexpected(); + } - const node = this.startNode(); - node.local = this.parseIdentifier(isDefault); - node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone(); - nodes.push(this.finishNode(node, "ExportSpecifier")); + return nodes; } - // https://github.com/ember-cli/ember-cli/pull/3739 - if (needsFrom && !this.isContextual("from")) { - this.unexpected(); - } + // Parses import declaration. - return nodes; -}; + parseImport(node) { + this.eat(tt._import); + + // import '...' + if (this.match(tt.string)) { + node.specifiers = []; + node.source = this.parseExprAtom(); + } else { + node.specifiers = []; + this.parseImportSpecifiers(node); + this.expectContextual("from"); + node.source = this.match(tt.string) ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } -// Parses import declaration. + // Parses a comma-separated list of module imports. -pp.parseImport = function (node) { - this.eat(tt._import); + parseImportSpecifiers(node) { + let first = true; + if (this.match(tt.name)) { + // import defaultObj, { x, y as z } from '...' + const startPos = this.state.start; + const startLoc = this.state.startLoc; + node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(), startPos, startLoc)); + if (!this.eat(tt.comma)) return; + } - // import '...' - if (this.match(tt.string)) { - node.specifiers = []; - node.source = this.parseExprAtom(); - } else { - node.specifiers = []; - this.parseImportSpecifiers(node); - this.expectContextual("from"); - node.source = this.match(tt.string) ? this.parseExprAtom() : this.unexpected(); - } - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); -}; - -// Parses a comma-separated list of module imports. - -pp.parseImportSpecifiers = function (node) { - let first = true; - if (this.match(tt.name)) { - // import defaultObj, { x, y as z } from '...' - const startPos = this.state.start; - const startLoc = this.state.startLoc; - node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(), startPos, startLoc)); - if (!this.eat(tt.comma)) return; - } + if (this.match(tt.star)) { + const specifier = this.startNode(); + this.next(); + this.expectContextual("as"); + specifier.local = this.parseIdentifier(); + this.checkLVal(specifier.local, true, undefined, "import namespace specifier"); + node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier")); + return; + } - if (this.match(tt.star)) { - const specifier = this.startNode(); - this.next(); - this.expectContextual("as"); - specifier.local = this.parseIdentifier(); - this.checkLVal(specifier.local, true, undefined, "import namespace specifier"); - node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier")); - return; - } + this.expect(tt.braceL); + while (!this.eat(tt.braceR)) { + if (first) { + first = false; + } else { + // Detect an attempt to deep destructure + if (this.eat(tt.colon)) { + this.unexpected(null, "ES2015 named imports do not destructure. Use another statement for destructuring after the import."); + } - this.expect(tt.braceL); - while (!this.eat(tt.braceR)) { - if (first) { - first = false; - } else { - // Detect an attempt to deep destructure - if (this.eat(tt.colon)) { - this.unexpected(null, "ES2015 named imports do not destructure. Use another statement for destructuring after the import."); + this.expect(tt.comma); + if (this.eat(tt.braceR)) break; } - this.expect(tt.comma); - if (this.eat(tt.braceR)) break; + this.parseImportSpecifier(node); } + } - this.parseImportSpecifier(node); + parseImportSpecifier(node) { + const specifier = this.startNode(); + specifier.imported = this.parseIdentifier(true); + if (this.eatContextual("as")) { + specifier.local = this.parseIdentifier(); + } else { + this.checkReservedWord(specifier.imported.name, specifier.start, true, true); + specifier.local = specifier.imported.__clone(); + } + this.checkLVal(specifier.local, true, undefined, "import specifier"); + node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); } -}; - -pp.parseImportSpecifier = function (node) { - const specifier = this.startNode(); - specifier.imported = this.parseIdentifier(true); - if (this.eatContextual("as")) { - specifier.local = this.parseIdentifier(); - } else { - this.checkReservedWord(specifier.imported.name, specifier.start, true, true); - specifier.local = specifier.imported.__clone(); + + parseImportSpecifierDefault(id, startPos, startLoc) { + const node = this.startNodeAt(startPos, startLoc); + node.local = id; + this.checkLVal(node.local, true, undefined, "default import specifier"); + return this.finishNode(node, "ImportDefaultSpecifier"); } - this.checkLVal(specifier.local, true, undefined, "import specifier"); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); -}; - -pp.parseImportSpecifierDefault = function (id, startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - node.local = id; - this.checkLVal(node.local, true, undefined, "default import specifier"); - return this.finishNode(node, "ImportDefaultSpecifier"); -}; +} diff --git a/src/parser/util.js b/src/parser/util.js index 86724e67c6..532e3fe7a4 100644 --- a/src/parser/util.js +++ b/src/parser/util.js @@ -1,88 +1,88 @@ import { types as tt } from "../tokenizer/types"; -import Parser from "./index"; +import Tokenizer from "../tokenizer"; import { lineBreak } from "../util/whitespace"; -const pp = Parser.prototype; - // ## Parser utilities -// TODO +export default class UtilParser extends Tokenizer { + // TODO -pp.addExtra = function (node, key, val) { - if (!node) return; + addExtra(node, key, val) { + if (!node) return; - const extra = node.extra = node.extra || {}; - extra[key] = val; -}; + const extra = node.extra = node.extra || {}; + extra[key] = val; + } -// TODO + // TODO -pp.isRelational = function (op) { - return this.match(tt.relational) && this.state.value === op; -}; + isRelational(op) { + return this.match(tt.relational) && this.state.value === op; + } -// TODO + // TODO -pp.expectRelational = function (op) { - if (this.isRelational(op)) { - this.next(); - } else { - this.unexpected(null, tt.relational); + expectRelational(op) { + if (this.isRelational(op)) { + this.next(); + } else { + this.unexpected(null, tt.relational); + } } -}; -// Tests whether parsed token is a contextual keyword. + // Tests whether parsed token is a contextual keyword. -pp.isContextual = function (name) { - return this.match(tt.name) && this.state.value === name; -}; + isContextual(name) { + return this.match(tt.name) && this.state.value === name; + } -// Consumes contextual keyword if possible. + // Consumes contextual keyword if possible. -pp.eatContextual = function (name) { - return this.state.value === name && this.eat(tt.name); -}; + eatContextual(name) { + return this.state.value === name && this.eat(tt.name); + } -// Asserts that following token is given contextual keyword. + // Asserts that following token is given contextual keyword. -pp.expectContextual = function (name, message) { - if (!this.eatContextual(name)) this.unexpected(null, message); -}; + expectContextual(name, message) { + if (!this.eatContextual(name)) this.unexpected(null, message); + } -// Test whether a semicolon can be inserted at the current position. + // Test whether a semicolon can be inserted at the current position. -pp.canInsertSemicolon = function () { - return this.match(tt.eof) || - this.match(tt.braceR) || - lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); -}; + canInsertSemicolon() { + return this.match(tt.eof) || + this.match(tt.braceR) || + lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); + } -// TODO + // TODO -pp.isLineTerminator = function () { - return this.eat(tt.semi) || this.canInsertSemicolon(); -}; + isLineTerminator() { + return this.eat(tt.semi) || this.canInsertSemicolon(); + } -// Consume a semicolon, or, failing that, see if we are allowed to -// pretend that there is a semicolon at this position. + // Consume a semicolon, or, failing that, see if we are allowed to + // pretend that there is a semicolon at this position. -pp.semicolon = function () { - if (!this.isLineTerminator()) this.unexpected(null, tt.semi); -}; + semicolon() { + if (!this.isLineTerminator()) this.unexpected(null, tt.semi); + } -// Expect a token of a given type. If found, consume it, otherwise, -// raise an unexpected token error at given pos. + // Expect a token of a given type. If found, consume it, otherwise, + // raise an unexpected token error at given pos. -pp.expect = function (type, pos) { - return this.eat(type) || this.unexpected(pos, type); -}; + expect(type, pos) { + return this.eat(type) || this.unexpected(pos, type); + } -// Raise an unexpected token error. Can take the expected token type -// instead of a message string. + // Raise an unexpected token error. Can take the expected token type + // instead of a message string. -pp.unexpected = function (pos, messageOrType = "Unexpected token") { - if (messageOrType && typeof messageOrType === "object" && messageOrType.label) { - messageOrType = `Unexpected token, expected ${messageOrType.label}`; + unexpected(pos, messageOrType = "Unexpected token") { + if (messageOrType && typeof messageOrType === "object" && messageOrType.label) { + messageOrType = `Unexpected token, expected ${messageOrType.label}`; + } + this.raise(pos != null ? pos : this.state.start, messageOrType); } - this.raise(pos != null ? pos : this.state.start, messageOrType); -}; +} diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index 74f03f3088..2303175c18 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -8,6 +8,7 @@ import type { Position } from "../util/location"; import { isIdentifierStart, isIdentifierChar, isKeyword } from "../util/identifier"; import { types as tt, keywords as keywordTypes } from "./types"; import { type TokContext, types as ct } from "./context"; +import LocationParser from "../parser/location"; import { SourceLocation } from "../util/location"; import { lineBreak, lineBreakG, isNewLine, nonASCIIwhitespace } from "../util/whitespace"; import State from "./state"; @@ -43,14 +44,8 @@ function codePointToString(code: number): string { } } -export default class Tokenizer { +export default class Tokenizer extends LocationParser { // Forward-declarations - // location.js - +raise: (pos: number, message: string) => empty; - // comments.js (TODO: Better type for the parameter) - +addComment: (comment: Object) => void; - // parser/index.js - +hasPlugin: (name: string) => boolean; // parser/util.js +unexpected: (pos?: ?number, messageOrType?: string | TokenType) => empty; @@ -59,6 +54,7 @@ export default class Tokenizer { input: string; constructor(options: Options, input: string) { + super(); this.state = new State; this.state.init(options, input); } From 68967bf5157163c3dccc611e851965abd34a3a64 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Sun, 23 Apr 2017 17:45:19 -0500 Subject: [PATCH 094/105] Remove jsx context when parsing arrow functions (#475) --- src/plugins/flow.js | 14 +- test/fixtures/flow/type-generics/1/actual.js | 1 + .../flow/type-generics/1/expected.json | 346 ++++++++++++++++++ test/fixtures/flow/type-generics/2/actual.js | 2 + .../flow/type-generics/2/expected.json | 340 +++++++++++++++++ 5 files changed, 695 insertions(+), 8 deletions(-) create mode 100644 test/fixtures/flow/type-generics/1/actual.js create mode 100644 test/fixtures/flow/type-generics/1/expected.json create mode 100644 test/fixtures/flow/type-generics/2/actual.js create mode 100644 test/fixtures/flow/type-generics/2/expected.json diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 0dcf624fe9..869ba2fc0d 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -1,7 +1,6 @@ /* eslint max-len: 0 */ import { types as tt } from "../tokenizer/types"; -import { types as ct } from "../tokenizer/context"; const primitiveTypes = [ "any", @@ -1437,6 +1436,12 @@ export default (superClass) => class extends superClass { } catch (err) { if (err instanceof SyntaxError) { this.state = state; + + // Remove `tc.j_expr` and `tc.j_oTag` from context added + // by parsing `jsxTagStart` to stop the JSX plugin from + // messing with the tokens + this.state.context.length -= 2; + jsxError = err; } else { // istanbul ignore next: no such error is expected @@ -1446,9 +1451,6 @@ export default (superClass) => class extends superClass { } if (jsxError != null || this.isRelational("<")) { - // Need to push something onto the context to stop - // the JSX plugin from messing with the tokens - this.state.context.push(ct.parenExpression); let arrowExpression; let typeParameters; try { @@ -1458,13 +1460,9 @@ export default (superClass) => class extends superClass { arrowExpression.typeParameters = typeParameters; this.resetStartLocationFromNode(arrowExpression, typeParameters); } catch (err) { - this.state.context.pop(); - throw jsxError || err; } - this.state.context.pop(); - if (arrowExpression.type === "ArrowFunctionExpression") { return arrowExpression; } else if (jsxError != null) { diff --git a/test/fixtures/flow/type-generics/1/actual.js b/test/fixtures/flow/type-generics/1/actual.js new file mode 100644 index 0000000000..f27ba81379 --- /dev/null +++ b/test/fixtures/flow/type-generics/1/actual.js @@ -0,0 +1 @@ +const functionReturningIdentityAsAField = () => ({ id: (value: T): T => value }); diff --git a/test/fixtures/flow/type-generics/1/expected.json b/test/fixtures/flow/type-generics/1/expected.json new file mode 100644 index 0000000000..40dcb01fe0 --- /dev/null +++ b/test/fixtures/flow/type-generics/1/expected.json @@ -0,0 +1,346 @@ +{ + "type": "File", + "start": 0, + "end": 84, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 84 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 84, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 84 + } + }, + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 84, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 84 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 83 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 39 + }, + "identifierName": "functionReturningIdentityAsAField" + }, + "name": "functionReturningIdentityAsAField" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 42, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 83 + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [], + "body": { + "type": "ObjectExpression", + "start": 49, + "end": 82, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 82 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 51, + "end": 80, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 80 + } + }, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 51, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 53 + }, + "identifierName": "id" + }, + "name": "id" + }, + "value": { + "type": "ArrowFunctionExpression", + "start": 55, + "end": 80, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 80 + } + }, + "predicate": null, + "returnType": { + "type": "TypeAnnotation", + "start": 68, + "end": 71, + "loc": { + "start": { + "line": 1, + "column": 68 + }, + "end": { + "line": 1, + "column": 71 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 70, + "end": 71, + "loc": { + "start": { + "line": 1, + "column": 70 + }, + "end": { + "line": 1, + "column": 71 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 70, + "end": 71, + "loc": { + "start": { + "line": 1, + "column": 70 + }, + "end": { + "line": 1, + "column": 71 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 59, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 67 + }, + "identifierName": "value" + }, + "name": "value", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 64, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 64 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 66, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 66 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 66, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 66 + }, + "end": { + "line": 1, + "column": 67 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "body": { + "type": "Identifier", + "start": 75, + "end": 80, + "loc": { + "start": { + "line": 1, + "column": 75 + }, + "end": { + "line": 1, + "column": 80 + }, + "identifierName": "value" + }, + "name": "value" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 55, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 56, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 56 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "name": "T", + "variance": null + } + ] + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 48 + } + } + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/flow/type-generics/2/actual.js b/test/fixtures/flow/type-generics/2/actual.js new file mode 100644 index 0000000000..e3a4739249 --- /dev/null +++ b/test/fixtures/flow/type-generics/2/actual.js @@ -0,0 +1,2 @@ +const identity = (t: T): T => t; +const a = 1; diff --git a/test/fixtures/flow/type-generics/2/expected.json b/test/fixtures/flow/type-generics/2/expected.json new file mode 100644 index 0000000000..07043bb8c9 --- /dev/null +++ b/test/fixtures/flow/type-generics/2/expected.json @@ -0,0 +1,340 @@ +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "identity" + }, + "name": "identity" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "predicate": null, + "returnType": { + "type": "TypeAnnotation", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + "id": null, + "generator": false, + "expression": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 21, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "t" + }, + "name": "t", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "body": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "t" + }, + "name": "t" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "name": "T", + "variance": null + } + ] + } + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 36, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 42, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file From 34acecca2e72dbbeb3b0964114cf0b76a5e038dc Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 25 Apr 2017 13:07:01 -0700 Subject: [PATCH 095/105] Type-check CommentsParser and LocationParser (#484) --- .flowconfig | 1 + src/parser/base.js | 7 +++++++ src/parser/comments.js | 13 +++++++------ src/parser/location.js | 7 +++++-- src/tokenizer/index.js | 2 -- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.flowconfig b/.flowconfig index ec70beff84..3dccffe4e4 100644 --- a/.flowconfig +++ b/.flowconfig @@ -11,3 +11,4 @@ strip_root=true suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe suppress_comment= \\(.\\|\n\\)*\\$FlowIssue +suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore diff --git a/src/parser/base.js b/src/parser/base.js index fa1fc13539..3795b71668 100644 --- a/src/parser/base.js +++ b/src/parser/base.js @@ -3,6 +3,8 @@ import type { Options } from "../options"; import { reservedWords } from "../util/identifier"; +import type State from "../tokenizer/state"; + export default class BaseParser { // Properties set by constructor in index.js options: Options; @@ -10,6 +12,11 @@ export default class BaseParser { plugins: { [key: string]: boolean }; filename: ?string; + // Initialized by Tokenizer + state: State; + input: string; + + isReservedWord(word: string): boolean { if (word === "await") { return this.inModule; diff --git a/src/parser/comments.js b/src/parser/comments.js index a634491848..c39f91e44a 100644 --- a/src/parser/comments.js +++ b/src/parser/comments.js @@ -1,5 +1,7 @@ /* eslint max-len: 0 */ +// @flow + /** * Based on the comment attachment algorithm used in espree and estraverse. * @@ -25,19 +27,20 @@ */ import BaseParser from "./base"; +import type { Comment, Node } from "../types"; function last(stack) { return stack[stack.length - 1]; } export default class CommentsParser extends BaseParser { - addComment(comment) { + addComment(comment: Comment): void { if (this.filename) comment.loc.filename = this.filename; this.state.trailingComments.push(comment); this.state.leadingComments.push(comment); } - processComment(node) { + processComment(node: Node): void { if (node.type === "Program" && node.body.length > 0) return; const stack = this.state.commentStack; @@ -127,10 +130,8 @@ export default class CommentsParser extends BaseParser { // that comes after the node. Keep in mind that this could // result in an empty array, and if so, the array must be // deleted. - node.leadingComments = this.state.leadingComments.slice(0, i); - if ((node.leadingComments: Array).length === 0) { - node.leadingComments = null; - } + const leadingComments = this.state.leadingComments.slice(0, i); + node.leadingComments = leadingComments.length === 0 ? null : leadingComments; // Similarly, trailing comments are attached later. The variable // must be reset to null if there are no trailing comments. diff --git a/src/parser/location.js b/src/parser/location.js index 1562f52fb6..aed2760d62 100644 --- a/src/parser/location.js +++ b/src/parser/location.js @@ -1,3 +1,5 @@ +// @flow + import { getLineInfo } from "../util/location"; import CommentsParser from "./comments"; @@ -8,10 +10,11 @@ import CommentsParser from "./comments"; // message. export default class LocationParser extends CommentsParser { - raise(pos, message) { + raise(pos: number, message: string): empty { const loc = getLineInfo(this.input, pos); message += ` (${loc.line}:${loc.column})`; - const err = new SyntaxError(message); + // $FlowIgnore + const err: SyntaxError & { pos: number, loc: Position } = new SyntaxError(message); err.pos = pos; err.loc = loc; throw err; diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index 2303175c18..fde3448c0d 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -49,9 +49,7 @@ export default class Tokenizer extends LocationParser { // parser/util.js +unexpected: (pos?: ?number, messageOrType?: string | TokenType) => empty; - state: State; isLookahead: boolean; - input: string; constructor(options: Options, input: string) { super(); From 3199ceecdbc04b5c50e102155bd9f2baf251b16b Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 25 Apr 2017 14:54:47 -0700 Subject: [PATCH 096/105] Type-check node.js (#486) --- src/parser/node.js | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/parser/node.js b/src/parser/node.js index dafe10af9b..cc8f514366 100644 --- a/src/parser/node.js +++ b/src/parser/node.js @@ -1,13 +1,16 @@ +// @flow + import Parser from "./index"; import UtilParser from "./util"; import { SourceLocation, type Position } from "../util/location"; +import type { Comment, Node as NodeType, NodeBase } from "../types"; // Start an AST node, attaching a start offset. const commentKeys = ["leadingComments", "trailingComments", "innerComments"]; -class Node { - constructor(parser?: Parser, pos?: number, loc?: Position) { +class Node implements NodeBase { + constructor(parser: Parser, pos: number, loc: Position) { this.type = ""; this.start = pos; this.end = 0; @@ -17,15 +20,22 @@ class Node { } type: string; - start: ?number; + start: number; end: number; loc: SourceLocation; + range: [number, number]; + leadingComments: ?Array; + trailingComments: ?Array; + innerComments: ?Array; + extra: { [key: string]: any }; - __clone(): Node { - const node2 = new Node; + __clone(): this { + // $FlowIgnore + const node2: any = new Node; for (const key in this) { // Do not clone comments that are already attached to the node if (commentKeys.indexOf(key) < 0) { + // $FlowIgnore node2[key] = this[key]; } } @@ -35,23 +45,25 @@ class Node { } export class NodeUtils extends UtilParser { - startNode() { + startNode(): T { + // $FlowIgnore return new Node(this, this.state.start, this.state.startLoc); } - startNodeAt(pos, loc) { + startNodeAt(pos: number, loc: Position): T { + // $FlowIgnore return new Node(this, pos, loc); } // Finish an AST node, adding `type` and `end` properties. - finishNode(node, type) { + finishNode(node: T, type: string): T { return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); } // Finish node at given position - finishNodeAt(node, type, pos, loc) { + finishNodeAt(node: T, type: string, pos: number, loc: Position): T { node.type = type; node.end = pos; node.loc.end = loc; @@ -63,11 +75,9 @@ export class NodeUtils extends UtilParser { /** * Reset the start location of node to the start location of locationNode */ - resetStartLocationFromNode(node, locationNode) { + resetStartLocationFromNode(node: NodeBase, locationNode: NodeBase): void { node.start = locationNode.start; node.loc.start = locationNode.loc.start; if (this.options.ranges) node.range[0] = locationNode.range[0]; - - return node; } } From 7627c5a2be47f2fd38f9df32f62d26577f40e732 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 25 Apr 2017 15:01:55 -0700 Subject: [PATCH 097/105] Type-check UtilParser (#485) --- src/parser/util.js | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/parser/util.js b/src/parser/util.js index 532e3fe7a4..891a193c25 100644 --- a/src/parser/util.js +++ b/src/parser/util.js @@ -1,5 +1,8 @@ -import { types as tt } from "../tokenizer/types"; +// @flow + +import { types as tt, type TokenType } from "../tokenizer/types"; import Tokenizer from "../tokenizer"; +import type { Node } from "../types"; import { lineBreak } from "../util/whitespace"; // ## Parser utilities @@ -7,7 +10,7 @@ import { lineBreak } from "../util/whitespace"; export default class UtilParser extends Tokenizer { // TODO - addExtra(node, key, val) { + addExtra(node: Node, key: string, val: any): void { if (!node) return; const extra = node.extra = node.extra || {}; @@ -16,13 +19,13 @@ export default class UtilParser extends Tokenizer { // TODO - isRelational(op) { + isRelational(op: "<" | ">"): boolean { return this.match(tt.relational) && this.state.value === op; } // TODO - expectRelational(op) { + expectRelational(op: "<" | ">"): void { if (this.isRelational(op)) { this.next(); } else { @@ -32,25 +35,25 @@ export default class UtilParser extends Tokenizer { // Tests whether parsed token is a contextual keyword. - isContextual(name) { + isContextual(name: string): boolean { return this.match(tt.name) && this.state.value === name; } // Consumes contextual keyword if possible. - eatContextual(name) { + eatContextual(name: string): boolean { return this.state.value === name && this.eat(tt.name); } // Asserts that following token is given contextual keyword. - expectContextual(name, message) { + expectContextual(name: string, message?: string): void { if (!this.eatContextual(name)) this.unexpected(null, message); } // Test whether a semicolon can be inserted at the current position. - canInsertSemicolon() { + canInsertSemicolon(): boolean { return this.match(tt.eof) || this.match(tt.braceR) || lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); @@ -58,31 +61,31 @@ export default class UtilParser extends Tokenizer { // TODO - isLineTerminator() { + isLineTerminator(): boolean { return this.eat(tt.semi) || this.canInsertSemicolon(); } // Consume a semicolon, or, failing that, see if we are allowed to // pretend that there is a semicolon at this position. - semicolon() { + semicolon(): void { if (!this.isLineTerminator()) this.unexpected(null, tt.semi); } // Expect a token of a given type. If found, consume it, otherwise, // raise an unexpected token error at given pos. - expect(type, pos) { - return this.eat(type) || this.unexpected(pos, type); + expect(type: TokenType, pos?: ?number): void { + this.eat(type) || this.unexpected(pos, type); } // Raise an unexpected token error. Can take the expected token type // instead of a message string. - unexpected(pos, messageOrType = "Unexpected token") { + unexpected(pos: ?number, messageOrType: string | TokenType = "Unexpected token"): empty { if (messageOrType && typeof messageOrType === "object" && messageOrType.label) { messageOrType = `Unexpected token, expected ${messageOrType.label}`; } - this.raise(pos != null ? pos : this.state.start, messageOrType); + throw this.raise(pos != null ? pos : this.state.start, messageOrType); } } From 47cade874c1add7b3f35a0939dbf26f7abd77f6b Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 26 Apr 2017 14:18:17 -0700 Subject: [PATCH 098/105] Type-check options.js and index.js (#490) --- src/index.js | 15 ++++++++++----- src/options.js | 30 +++++++++++++++++------------- src/parser/index.js | 4 ++-- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/index.js b/src/index.js index a797b55f15..09a5c40cbe 100755 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,6 @@ +// @flow + +import type { Options } from "./options"; import Parser, { plugins } from "./parser"; import "./parser/util"; import "./parser/statement"; @@ -11,6 +14,8 @@ import { types as tokTypes } from "./tokenizer/types"; import "./tokenizer"; import "./tokenizer/context"; +import type { Expression, File } from "./types"; + import estreePlugin from "./plugins/estree"; import flowPlugin from "./plugins/flow"; import jsxPlugin from "./plugins/jsx"; @@ -18,11 +23,11 @@ plugins.estree = estreePlugin; plugins.flow = flowPlugin; plugins.jsx = jsxPlugin; -export function parse(input, options) { +export function parse(input: string, options?: Options): File { return getParser(options, input).parse(); } -export function parseExpression(input, options) { +export function parseExpression(input: string, options?: Options): Expression { const parser = getParser(options, input); if (parser.options.strictMode) { parser.state.strict = true; @@ -33,15 +38,15 @@ export function parseExpression(input, options) { export { tokTypes }; -function getParser(options, input) { +function getParser(options: ?Options, input: string): Parser { const cls = options && options.plugins ? getParserClass(options.plugins) : Parser; return new cls(options, input); } -const parserClassCache = {}; +const parserClassCache: { [key: string]: Class } = {}; /** Get a Parser class with plugins applied. */ -function getParserClass(pluginsFromOptions) { +function getParserClass(pluginsFromOptions: $ReadOnlyArray): Class { // Filter out just the plugins that have an actual mixin associated with them. let pluginList = pluginsFromOptions.filter((p) => p === "estree" || p === "flow" || p === "jsx"); diff --git a/src/options.js b/src/options.js index ad75996fce..72d65ed0df 100755 --- a/src/options.js +++ b/src/options.js @@ -1,17 +1,21 @@ +// @flow + // A second optional argument can be given to further configure // the parser process. These options are recognized: -export const defaultOptions: { - sourceType: string, - sourceFilename: any, - startLine: number, - allowReturnOutsideFunction: boolean, - allowImportExportEverywhere: boolean, - allowSuperOutsideMethod: boolean, - plugins: Array, - strictMode: any, - ranges: boolean, -} = { +export type Options = { + sourceType: "script" | "module"; + sourceFilename?: string; + startLine: number; + allowReturnOutsideFunction: boolean; + allowImportExportEverywhere: boolean; + allowSuperOutsideMethod: boolean; + plugins: $ReadOnlyArray; + strictMode: ?boolean; + ranges: boolean; +}; + +export const defaultOptions: Options = { // Source type ("script" or "module") for different semantics sourceType: "script", // Source filename. @@ -44,8 +48,8 @@ export const defaultOptions: { // Interpret and default an options object -export function getOptions(opts?: Object): Object { - const options = {}; +export function getOptions(opts: ?Options): Options { + const options: any = {}; for (const key in defaultOptions) { options[key] = opts && key in opts ? opts[key] : defaultOptions[key]; } diff --git a/src/parser/index.js b/src/parser/index.js index 41ce90fde2..7a66b89a54 100644 --- a/src/parser/index.js +++ b/src/parser/index.js @@ -5,10 +5,10 @@ import type { File } from "../types"; import { getOptions } from "../options"; import StatementParser from "./statement"; -export const plugins = {}; +export const plugins: { [name: string]: (superClass: Class) => Class } = {}; export default class Parser extends StatementParser { - constructor(options: Options, input: string) { + constructor(options: ?Options, input: string) { options = getOptions(options); super(options, input); From e1a06544bccda0e899965ae5db67decc4ea4d76e Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 27 Apr 2017 07:23:13 -0700 Subject: [PATCH 099/105] Type-check utils (#491) * Type-check utils * Improve test coverage --- src/tokenizer/index.js | 1 + src/util/identifier.js | 17 ++++++++++------- src/util/location.js | 18 +++++++++++++++++- src/util/whitespace.js | 2 ++ 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index fde3448c0d..34f75fa490 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -809,6 +809,7 @@ export default class Tokenizer extends LocationParser { ++this.state.pos; const esc = this.readCodePoint(true); + // $FlowFixMe (thinks esc may be null, but throwOnInvalid is true) if (!(first ? isIdentifierStart : isIdentifierChar)(esc, true)) { this.raise(escStart, "Invalid Unicode escape"); } diff --git a/src/util/identifier.js b/src/util/identifier.js index d8a9c83c49..3fc6ab2cde 100644 --- a/src/util/identifier.js +++ b/src/util/identifier.js @@ -1,5 +1,7 @@ /* eslint max-len: 0 */ +// @flow + // This is a trick taken from Esprima. It turns out that, on // non-Chrome browsers, to check whether a string is in a set, a // predicate containing a big ugly `switch` statement is faster than @@ -9,17 +11,17 @@ // // It starts by sorting the words by length. -function makePredicate(words) { - words = words.split(" "); +function makePredicate(words: string): (str: string) => boolean { + const wordsArr = words.split(" "); return function (str) { - return words.indexOf(str) >= 0; + return wordsArr.indexOf(str) >= 0; }; } // Reserved word lists for various dialects of the language export const reservedWords = { - 6: makePredicate("enum await"), + "6": makePredicate("enum await"), strict: makePredicate("implements interface let package private protected public static yield"), strictBind: makePredicate("eval arguments") }; @@ -57,7 +59,7 @@ const astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,1 // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is // rare. -function isInAstralSet(code, set) { +function isInAstralSet(code: number, set: $ReadOnlyArray): boolean { let pos = 0x10000; for (let i = 0; i < set.length; i += 2) { pos += set[i]; @@ -66,11 +68,12 @@ function isInAstralSet(code, set) { pos += set[i + 1]; if (pos >= code) return true; } + return false; } // Test whether a given character code starts an identifier. -export function isIdentifierStart(code) { +export function isIdentifierStart(code: number): boolean { if (code < 65) return code === 36; if (code < 91) return true; if (code < 97) return code === 95; @@ -81,7 +84,7 @@ export function isIdentifierStart(code) { // Test whether a given character is part of an identifier. -export function isIdentifierChar(code) { +export function isIdentifierChar(code: number): boolean { if (code < 48) return code === 36; if (code < 58) return true; if (code < 65) return false; diff --git a/src/util/location.js b/src/util/location.js index fb53aab1c5..aaa4ae531c 100644 --- a/src/util/location.js +++ b/src/util/location.js @@ -1,9 +1,18 @@ +// @flow + import { lineBreakG } from "./whitespace"; +export type Pos = { + start: number; +} + // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. export class Position { + line: number; + column: number; + constructor(line: number, col: number) { this.line = line; this.column = col; @@ -11,8 +20,13 @@ export class Position { } export class SourceLocation { + start: Position; + end: Position; + filename: string; + constructor(start: Position, end?: Position) { this.start = start; + // $FlowIgnore (may start as null, but initialized later) this.end = end; } } @@ -23,7 +37,7 @@ export class SourceLocation { // offset. `input` should be the code string that the offset refers // into. -export function getLineInfo(input, offset) { +export function getLineInfo(input: string, offset: number): Position { for (let line = 1, cur = 0; ;) { lineBreakG.lastIndex = cur; const match = lineBreakG.exec(input); @@ -34,4 +48,6 @@ export function getLineInfo(input, offset) { return new Position(line, offset - cur); } } + // istanbul ignore next + throw new Error("Unreachable"); } diff --git a/src/util/whitespace.js b/src/util/whitespace.js index e345a4cf5e..0588213ecd 100644 --- a/src/util/whitespace.js +++ b/src/util/whitespace.js @@ -1,3 +1,5 @@ +// @flow + // Matches a whole line break (where CRLF is considered a single // line break). Used to count lines. From d8ff63181e23ec2e8fbef38da6b5c733217ff23a Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 27 Apr 2017 07:37:08 -0700 Subject: [PATCH 100/105] Type-check LValParser (#487) --- src/parser/lval.js | 57 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/src/parser/lval.js b/src/parser/lval.js index b3d33baf3d..811c37038a 100644 --- a/src/parser/lval.js +++ b/src/parser/lval.js @@ -1,11 +1,28 @@ -import { types as tt } from "../tokenizer/types"; +// @flow + +import { types as tt, type TokenType } from "../tokenizer/types"; +import type { Decorator, Expression, Identifier, Node, ObjectExpression, ObjectPattern, Pattern, RestElement, + SpreadElement } from "../types"; +import type { Pos, Position } from "../util/location"; import { NodeUtils } from "./node"; export default class LValParser extends NodeUtils { + // Forward-declaration: defined in expression.js + +checkReservedWord: (word: string, startLoc: number, checkKeywords: boolean, isBinding: boolean) => void; + +parseIdentifier: (liberal?: boolean) => Identifier; + +parseMaybeAssign: ( + noIn?: ?boolean, + refShorthandDefaultPos?: ?Pos, + afterLeftParse?: Function, + refNeedsArrowPos?: ?Pos) => Expression; + +parseObj: (isPattern: boolean, refShorthandDefaultPos?: ?Pos) => T; + // Forward-declaration: defined in statement.js + +parseDecorator: () => Decorator; + // Convert existing expression atom to assignable pattern // if possible. - toAssignable(node, isBinding, contextDescription) { + toAssignable(node: Node, isBinding: ?boolean, contextDescription: string): Node { if (node) { switch (node.type) { case "Identifier": @@ -16,7 +33,7 @@ export default class LValParser extends NodeUtils { case "ObjectExpression": node.type = "ObjectPattern"; - for (const prop of (node.properties: Array)) { + for (const prop of node.properties) { if (prop.type === "ObjectMethod") { if (prop.kind === "get" || prop.kind === "set") { this.raise(prop.key.start, "Object pattern can't contain getter or setter"); @@ -66,7 +83,8 @@ export default class LValParser extends NodeUtils { // Convert list of expression atoms to binding list. - toAssignableList(exprList, isBinding, contextDescription) { + toAssignableList( + exprList: Expression[], isBinding: ?boolean, contextDescription: string): $ReadOnlyArray { let end = exprList.length; if (end) { const last = exprList[end - 1]; @@ -93,36 +111,36 @@ export default class LValParser extends NodeUtils { // Convert list of expression atoms to a list of - toReferencedList(exprList) { + toReferencedList(exprList: $ReadOnlyArray): $ReadOnlyArray { return exprList; } // Parses spread element. - parseSpread(refShorthandDefaultPos) { + parseSpread(refShorthandDefaultPos: ?Pos): T { const node = this.startNode(); this.next(); node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos); return this.finishNode(node, "SpreadElement"); } - parseRest() { + parseRest(): RestElement { const node = this.startNode(); this.next(); node.argument = this.parseBindingAtom(); return this.finishNode(node, "RestElement"); } - shouldAllowYieldIdentifier() { + shouldAllowYieldIdentifier(): boolean { return this.match(tt._yield) && !this.state.strict && !this.state.inGenerator; } - parseBindingIdentifier() { + parseBindingIdentifier(): Identifier { return this.parseIdentifier(this.shouldAllowYieldIdentifier()); } // Parses lvalue (assignable) atom. - parseBindingAtom() { + parseBindingAtom(): Pattern { switch (this.state.type) { case tt._yield: case tt.name: @@ -138,11 +156,11 @@ export default class LValParser extends NodeUtils { return this.parseObj(true); default: - this.unexpected(); + throw this.unexpected(); } } - parseBindingList(close, allowEmpty) { + parseBindingList(close: TokenType, allowEmpty?: boolean): $ReadOnlyArray { const elts = []; let first = true; while (!this.eat(close)) { @@ -152,6 +170,7 @@ export default class LValParser extends NodeUtils { this.expect(tt.comma); } if (allowEmpty && this.match(tt.comma)) { + // $FlowFixMe This method returns `$ReadOnlyArray` if `allowEmpty` is set. elts.push(null); } else if (this.eat(close)) { break; @@ -175,13 +194,13 @@ export default class LValParser extends NodeUtils { return elts; } - parseAssignableListItemTypes(param) { + parseAssignableListItemTypes(param: Pattern): Pattern { return param; } // Parses assignment pattern around given atom if possible. - parseMaybeDefault(startPos, startLoc, left) { + parseMaybeDefault(startPos?: ?number, startLoc?: ?Position, left?: ?Pattern): Pattern { startLoc = startLoc || this.state.startLoc; startPos = startPos || this.state.start; left = left || this.parseBindingAtom(); @@ -196,7 +215,11 @@ export default class LValParser extends NodeUtils { // Verify that a node is an lval — something that can be assigned // to. - checkLVal(expr, isBinding, checkClashes, contextDescription) { + checkLVal( + expr: Expression, + isBinding: ?boolean, + checkClashes: ?{ [key: string]: boolean }, + contextDescription: string): void { switch (expr.type) { case "Identifier": this.checkReservedWord(expr.name, expr.start, false, true); @@ -229,14 +252,14 @@ export default class LValParser extends NodeUtils { break; case "ObjectPattern": - for (let prop of (expr.properties: Array)) { + for (let prop of expr.properties) { if (prop.type === "ObjectProperty") prop = prop.value; this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern"); } break; case "ArrayPattern": - for (const elem of (expr.elements: Array)) { + for (const elem of expr.elements) { if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern"); } break; From cd5bfb786aaabf0c25d4d178c99c8e4588ac0881 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 27 Apr 2017 07:40:51 -0700 Subject: [PATCH 101/105] Type-check estree plugin (#494) --- src/plugins/estree.js | 54 ++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/src/plugins/estree.js b/src/plugins/estree.js index 3d9f9477a7..e4b7041774 100644 --- a/src/plugins/estree.js +++ b/src/plugins/estree.js @@ -1,14 +1,18 @@ +// @flow + import { types as tt } from "../tokenizer/types"; +import type Parser from "../parser"; +import * as N from "../types"; -function isSimpleProperty(node) { - return node && +function isSimpleProperty(node: N.Node): boolean { + return node != null && node.type === "Property" && node.kind === "init" && node.method === false; } -export default (superClass) => class extends superClass { - estreeParseRegExpLiteral({ pattern, flags }) { +export default (superClass: Class): Class => class extends superClass { + estreeParseRegExpLiteral({ pattern, flags }: N.RegExpLiteral): N.Node { let regex = null; try { regex = new RegExp(pattern, flags); @@ -22,11 +26,11 @@ export default (superClass) => class extends superClass { return node; } - estreeParseLiteral(value) { + estreeParseLiteral(value: any): N.Node { return this.parseLiteral(value, "Literal"); } - directiveToStmt(directive) { + directiveToStmt(directive: N.Directive): N.ExpressionStatement { const directiveLiteral = directive.value; const stmt = this.startNodeAt(directive.start, directive.loc.start); @@ -46,15 +50,16 @@ export default (superClass) => class extends superClass { // Overrides // ================================== - checkDeclaration(node) { + checkDeclaration(node: N.Pattern): void { if (isSimpleProperty(node)) { + // $FlowFixMe this.checkDeclaration(node.value); } else { super.checkDeclaration(node); } } - checkGetterSetterParamCount(prop) { + checkGetterSetterParamCount(prop: N.ObjectMethod): void { const paramCount = prop.kind === "get" ? 0 : 1; if (prop.value.params.length !== paramCount) { const start = prop.start; @@ -66,7 +71,8 @@ export default (superClass) => class extends superClass { } } - checkLVal(expr, isBinding, checkClashes, ...args) { + checkLVal( + expr: N.Expression, isBinding: ?boolean, checkClashes: ?{ [key: string]: boolean }, ...args): void { switch (expr.type) { case "ObjectPattern": expr.properties.forEach((prop) => { @@ -83,7 +89,7 @@ export default (superClass) => class extends superClass { } } - checkPropClash(prop, propHash) { + checkPropClash(prop: N.ObjectMember, propHash: { [key: string]: boolean }): void { if (prop.computed || !isSimpleProperty(prop)) return; const key = prop.key; @@ -96,9 +102,9 @@ export default (superClass) => class extends superClass { } } - isStrictBody(node, isExpression) { + isStrictBody(node: { body: N.BlockStatement }, isExpression?: boolean): boolean { if (!isExpression && node.body.body.length > 0) { - for (const directive of (node.body.body: Array)) { + for (const directive of node.body.body) { if (directive.type === "ExpressionStatement" && directive.expression.type === "Literal") { if (directive.expression.value === "use strict") return true; } else { @@ -111,19 +117,18 @@ export default (superClass) => class extends superClass { return false; } - isValidDirective(stmt) { + isValidDirective(stmt: N.Statement): boolean { return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && (!stmt.expression.extra || !stmt.expression.extra.parenthesized); } - parseBlockBody(node, ...args) { + parseBlockBody(node: N.BlockStatementLike, ...args): void { super.parseBlockBody(node, ...args); - node.directives.reverse().forEach((directive) => { - node.body.unshift(this.directiveToStmt(directive)); - }); + const directiveStatements = node.directives.map((d) => this.directiveToStmt(d)); + node.body = directiveStatements.concat(node.body); delete node.directives; } @@ -134,7 +139,7 @@ export default (superClass) => class extends superClass { body[body.length - 1].type = "MethodDefinition"; } - parseExprAtom(...args) { + parseExprAtom(...args): N.Expression { switch (this.state.type) { case tt.regexp: return this.estreeParseRegExpLiteral(this.state.value); @@ -157,7 +162,7 @@ export default (superClass) => class extends superClass { } } - parseLiteral(...args) { + parseLiteral(...args): T { const node = super.parseLiteral(...args); node.raw = node.extra.raw; delete node.extra; @@ -165,17 +170,18 @@ export default (superClass) => class extends superClass { return node; } - parseMethod(node, ...args) { + parseMethod(node: N.MethodLike, ...args): N.MethodLike { let funcNode = this.startNode(); funcNode.kind = node.kind; // provide kind, so super method correctly sets state funcNode = super.parseMethod(funcNode, ...args); delete funcNode.kind; + // $FlowIgnore node.value = this.finishNode(funcNode, "FunctionExpression"); return node; } - parseObjectMethod(...args) { + parseObjectMethod(...args): ?N.ObjectMethod { const node = super.parseObjectMethod(...args); if (node) { @@ -186,7 +192,7 @@ export default (superClass) => class extends superClass { return node; } - parseObjectProperty(...args) { + parseObjectProperty(...args): ?N.ObjectProperty { const node = super.parseObjectProperty(...args); if (node) { @@ -197,14 +203,14 @@ export default (superClass) => class extends superClass { return node; } - toAssignable(node, isBinding, ...args) { + toAssignable(node: N.Node, isBinding: ?boolean, ...args): N.Node { if (isSimpleProperty(node)) { this.toAssignable(node.value, isBinding, ...args); return node; } else if (node.type === "ObjectExpression") { node.type = "ObjectPattern"; - for (const prop of (node.properties: Array)) { + for (const prop of node.properties) { if (prop.kind === "get" || prop.kind === "set") { this.raise(prop.key.start, "Object pattern can't contain getter or setter"); } else if (prop.method) { From 8288f7d9e45c254158509cb23e231a3525d74197 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 27 Apr 2017 07:53:17 -0700 Subject: [PATCH 102/105] Type-check tokenizer/types.js (#493) --- src/parser/util.js | 2 +- src/tokenizer/context.js | 2 ++ src/tokenizer/types.js | 35 +++++++++++++++++++++++++++++++---- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/parser/util.js b/src/parser/util.js index 891a193c25..89ec41154e 100644 --- a/src/parser/util.js +++ b/src/parser/util.js @@ -83,7 +83,7 @@ export default class UtilParser extends Tokenizer { // instead of a message string. unexpected(pos: ?number, messageOrType: string | TokenType = "Unexpected token"): empty { - if (messageOrType && typeof messageOrType === "object" && messageOrType.label) { + if (typeof messageOrType !== "string") { messageOrType = `Unexpected token, expected ${messageOrType.label}`; } throw this.raise(pos != null ? pos : this.state.start, messageOrType); diff --git a/src/tokenizer/context.js b/src/tokenizer/context.js index 81db0499c3..7b7b97b6d7 100644 --- a/src/tokenizer/context.js +++ b/src/tokenizer/context.js @@ -1,3 +1,5 @@ +// @flow + // The algorithm used to determine whether a regexp can appear at a // given point in the program is loosely based on sweet.js' approach. // See https://github.com/mozilla/sweet.js/wiki/design diff --git a/src/tokenizer/types.js b/src/tokenizer/types.js index 1d78aabb40..e6552249e6 100644 --- a/src/tokenizer/types.js +++ b/src/tokenizer/types.js @@ -1,3 +1,5 @@ +// @flow + // ## Token types // The assignment of fine-grained, information-carrying type objects @@ -23,8 +25,33 @@ const isAssign = true; const prefix = true; const postfix = true; +type TokenOptions = { + keyword?: string; + + beforeExpr?: boolean; + startsExpr?: boolean; + rightAssociative?: boolean; + isLoop?: boolean; + isAssign?: boolean; + prefix?: boolean; + postfix?: boolean; + binop?: ?number; +}; + export class TokenType { - constructor(label, conf = {}) { + label: string; + keyword: ?string; + beforeExpr: boolean; + startsExpr: boolean; + rightAssociative: boolean; + isLoop: boolean; + isAssign: boolean; + prefix: boolean; + postfix: boolean; + binop: ?number; + updateContext: ?((prevType: TokenType) => void); + + constructor(label: string, conf: TokenOptions = {}) { this.label = label; this.keyword = conf.keyword; this.beforeExpr = !!conf.beforeExpr; @@ -40,7 +67,7 @@ export class TokenType { } class KeywordTokenType extends TokenType { - constructor(name, options = {}) { + constructor(name: string, options: TokenOptions = {}) { options.keyword = name; super(name, options); @@ -48,12 +75,12 @@ class KeywordTokenType extends TokenType { } export class BinopTokenType extends TokenType { - constructor(name, prec) { + constructor(name: string, prec: number) { super(name, { beforeExpr, binop: prec }); } } -export const types = { +export const types: { [name: string]: TokenType } = { num: new TokenType("num", { startsExpr }), regexp: new TokenType("regexp", { startsExpr }), string: new TokenType("string", { startsExpr }), From cccee0060621373c6c5d54d335eed5fa469ec5e7 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 27 Apr 2017 07:58:33 -0700 Subject: [PATCH 103/105] Type-check JSX plugin (#496) * Type-check JSX plugin * Improve test coverage --- src/plugins/jsx/index.js | 60 +++++++++++++++++++++++----------------- src/plugins/jsx/xhtml.js | 5 +++- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/src/plugins/jsx/index.js b/src/plugins/jsx/index.js index c309d2c965..0d8e6b91a5 100644 --- a/src/plugins/jsx/index.js +++ b/src/plugins/jsx/index.js @@ -1,7 +1,12 @@ +// @flow + import XHTMLEntities from "./xhtml"; +import type Parser from "../../parser"; import { TokenType, types as tt } from "../../tokenizer/types"; import { TokContext, types as tc } from "../../tokenizer/context"; +import * as N from "../../types"; import { isIdentifierChar, isIdentifierStart } from "../../util/identifier"; +import type { Pos, Position } from "../../util/location"; import { isNewLine } from "../../util/whitespace"; const HEX_NUMBER = /^[\da-fA-F]+$/; @@ -34,7 +39,7 @@ tt.jsxTagEnd.updateContext = function(prevType) { // Transforms JSX element name to string. -function getQualifiedJSXName(object) { +function getQualifiedJSXName(object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression): string { if (object.type === "JSXIdentifier") { return object.name; } @@ -46,12 +51,15 @@ function getQualifiedJSXName(object) { if (object.type === "JSXMemberExpression") { return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); } + + // istanbul ignore next + throw new Error("Node had unexpected type: " + object.type); } -export default (superClass) => class extends superClass { +export default (superClass: Class): Class => class extends superClass { // Reads inline JSX contents token. - jsxReadToken() { + jsxReadToken(): void { let out = ""; let chunkStart = this.state.pos; for (;;) { @@ -92,7 +100,7 @@ export default (superClass) => class extends superClass { } } - jsxReadNewLine(normalizeCRLF) { + jsxReadNewLine(normalizeCRLF: boolean): string { const ch = this.input.charCodeAt(this.state.pos); let out; ++this.state.pos; @@ -108,7 +116,7 @@ export default (superClass) => class extends superClass { return out; } - jsxReadString(quote) { + jsxReadString(quote: number): void { let out = ""; let chunkStart = ++this.state.pos; for (;;) { @@ -134,7 +142,7 @@ export default (superClass) => class extends superClass { return this.finishToken(tt.string, out); } - jsxReadEntity() { + jsxReadEntity(): string { let str = ""; let count = 0; let entity; @@ -176,7 +184,7 @@ export default (superClass) => class extends superClass { // Also assumes that first character was already checked // by isIdentifierStart in readToken. - jsxReadWord() { + jsxReadWord(): void { let ch; const start = this.state.pos; do { @@ -187,7 +195,7 @@ export default (superClass) => class extends superClass { // Parse next token as JSX identifier - jsxParseIdentifier() { + jsxParseIdentifier(): N.JSXIdentifier { const node = this.startNode(); if (this.match(tt.jsxName)) { node.name = this.state.value; @@ -202,7 +210,7 @@ export default (superClass) => class extends superClass { // Parse namespaced identifier. - jsxParseNamespacedName() { + jsxParseNamespacedName(): N.JSXNamespacedName { const startPos = this.state.start; const startLoc = this.state.startLoc; const name = this.jsxParseIdentifier(); @@ -217,7 +225,7 @@ export default (superClass) => class extends superClass { // Parses element name in any form - namespaced, member // or single identifier. - jsxParseElementName() { + jsxParseElementName(): N.JSXNamespacedName | N.JSXMemberExpression { const startPos = this.state.start; const startLoc = this.state.startLoc; let node = this.jsxParseNamespacedName(); @@ -232,13 +240,13 @@ export default (superClass) => class extends superClass { // Parses any type of JSX attribute value. - jsxParseAttributeValue() { + jsxParseAttributeValue(): N.Expression { let node; switch (this.state.type) { case tt.braceL: node = this.jsxParseExpressionContainer(); if (node.expression.type === "JSXEmptyExpression") { - this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); + throw this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); } else { return node; } @@ -248,7 +256,7 @@ export default (superClass) => class extends superClass { return this.parseExprAtom(); default: - this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); + throw this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); } } @@ -256,14 +264,14 @@ export default (superClass) => class extends superClass { // and so it should start at the end of last read token (left brace) and finish // at the beginning of the next one (right brace). - jsxParseEmptyExpression() { + jsxParseEmptyExpression(): N.JSXEmptyExpression { const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc); return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc); } // Parse JSX spread child - jsxParseSpreadChild() { + jsxParseSpreadChild(): N.JSXSpreadChild { const node = this.startNode(); this.expect(tt.braceL); this.expect(tt.ellipsis); @@ -276,7 +284,7 @@ export default (superClass) => class extends superClass { // Parses JSX expression enclosed into curly brackets. - jsxParseExpressionContainer() { + jsxParseExpressionContainer(): N.JSXExpressionContainer { const node = this.startNode(); this.next(); if (this.match(tt.braceR)) { @@ -290,7 +298,7 @@ export default (superClass) => class extends superClass { // Parses following JSX attribute name-value pair. - jsxParseAttribute() { + jsxParseAttribute(): N.JSXAttribute { const node = this.startNode(); if (this.eat(tt.braceL)) { this.expect(tt.ellipsis); @@ -305,7 +313,7 @@ export default (superClass) => class extends superClass { // Parses JSX opening tag starting after "<". - jsxParseOpeningElementAt(startPos, startLoc) { + jsxParseOpeningElementAt(startPos: number, startLoc: Position): N.JSXOpeningElement { const node = this.startNodeAt(startPos, startLoc); node.attributes = []; node.name = this.jsxParseElementName(); @@ -319,7 +327,7 @@ export default (superClass) => class extends superClass { // Parses JSX closing tag starting after " class extends superClass { // Parses entire JSX element, including it"s opening tag // (starting after "<"), attributes, contents and closing tag. - jsxParseElementAt(startPos, startLoc) { + jsxParseElementAt(startPos: number, startLoc: Position): N.JSXElement { const node = this.startNodeAt(startPos, startLoc); const children = []; const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc); @@ -363,12 +371,14 @@ export default (superClass) => class extends superClass { // istanbul ignore next - should never happen default: - this.unexpected(); + throw this.unexpected(); } } + // $FlowIgnore if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { this.raise( + // $FlowIgnore closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">" ); @@ -386,7 +396,7 @@ export default (superClass) => class extends superClass { // Parses entire JSX element from current position. - jsxParseElement() { + jsxParseElement(): N.JSXElement { const startPos = this.state.start; const startLoc = this.state.startLoc; this.next(); @@ -397,7 +407,7 @@ export default (superClass) => class extends superClass { // Overrides // ================================== - parseExprAtom(refShortHandDefaultPos) { + parseExprAtom(refShortHandDefaultPos: ?Pos): N.Expression { if (this.match(tt.jsxText)) { return this.parseLiteral(this.state.value, "JSXText"); } else if (this.match(tt.jsxTagStart)) { @@ -407,7 +417,7 @@ export default (superClass) => class extends superClass { } } - readToken(code) { + readToken(code: number): void { if (this.state.inPropertyName) return super.readToken(code); const context = this.curContext(); @@ -439,7 +449,7 @@ export default (superClass) => class extends superClass { return super.readToken(code); } - updateContext(prevType) { + updateContext(prevType: TokenType): void { if (this.match(tt.braceL)) { const curContext = this.curContext(); if (curContext === tc.j_oTag) { diff --git a/src/plugins/jsx/xhtml.js b/src/plugins/jsx/xhtml.js index 232f8b1b1a..022c4e94ac 100644 --- a/src/plugins/jsx/xhtml.js +++ b/src/plugins/jsx/xhtml.js @@ -1,4 +1,6 @@ -export default { +// @flow + +const entities: { [name: string]: string } = { quot: "\u0022", amp: "&", apos: "\u0027", @@ -253,3 +255,4 @@ export default { hearts: "\u2665", diams: "\u2666" }; +export default entities; From 5ae165d4899d7b364aa48ed56b13ea1ce26fddf7 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 27 Apr 2017 11:16:48 -0400 Subject: [PATCH 104/105] update changelog [skip ci] --- CHANGELOG.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 161458e9c7..b7a486500a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,78 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) for the pre-6.8.0 version Changelog. -## 7.0.0-beta.4 (2017-03-01) +## v6.17.0 (2017-04-20) + +### :bug: Bug Fix + * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie) + * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons) + * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng) + * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons) + * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng) + * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng) + +## 7.0.0-beta.8 (2017-04-04) + +### New Feature +* Add support for flow type spread (#418) (Conrad Buck) +* Allow statics in flow interfaces (#427) (Brian Ng) + +### Bug Fix +* Fix predicate attachment to match flow parser (#428) (Brian Ng) +* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray) +* Fix rest parameters with array and objects (#424) (Brian Ng) +* Fix number parser (#433) (Alex Kuzmenko) + +### Docs +* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko) + +### Internal +* Use babel-register script when running babel smoke tests (#442) (Brian Ng) + +## 7.0.0-beta.7 (2017-03-22) + +### Spec Compliancy +* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu) + +### Bug Fix + +* Fix push-pop logic in flow (#405) (Daniel Tschinder) + +## 7.0.0-beta.6 (2017-03-21) + +### New Feature +* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons) + +### Polish +* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal) + +### Docs + +* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning) + +## 7.0.0-beta.5 (2017-03-21) + +### Bug Fix +* Throw error if new.target is used outside of a function (#402) (Brian Ng) +* Fix parsing of class properties (#351) (Kevin Gibbons) + +### Other + * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy) + * Optimize travis builds (#419) (Daniel Tschinder) + * Update codecov to 2.0 (#412) (Daniel Tschinder) + * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy) + * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning) + * Upgrade flow to 0.41 (Daniel Tschinder) + * Fix watch command (#403) (Brian Ng) + * Update yarn lock (Daniel Tschinder) + * Fix watch command (#403) (Brian Ng) + * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot]) + * Add estree test for correct order of directives (Daniel Tschinder) + * Add DoExpression to spec (#364) (Alex Kuzmenko) + * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde) + * Explain how to run only one test (#389) [skip ci] (Aaron Ang) + + ## 7.0.0-beta.4 (2017-03-01) * Don't consume async when checking for async func decl (#377) (Brian Ng) * add `ranges` option [skip ci] (Henry Zhu) From e81b5f8af273e92667696c51a870c64c4a163b18 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 27 Apr 2017 09:04:06 -0700 Subject: [PATCH 105/105] Type-check flow plugin (#495) * Type-check flow plugin * Fix typo --- src/plugins/flow.js | 206 +++++++++++++++++++++++--------------------- src/types.js | 3 + 2 files changed, 113 insertions(+), 96 deletions(-) diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 869ba2fc0d..cad3c4b645 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -1,6 +1,11 @@ /* eslint max-len: 0 */ -import { types as tt } from "../tokenizer/types"; +// @flow + +import type Parser from "../parser"; +import { types as tt, type TokenType } from "../tokenizer/types"; +import * as N from "../types"; +import type { Pos, Position } from "../util/location"; const primitiveTypes = [ "any", @@ -14,7 +19,7 @@ const primitiveTypes = [ "null" ]; -function isEsModuleType(bodyElement) { +function isEsModuleType(bodyElement: N.Node): boolean { return bodyElement.type === "DeclareExportAllDeclaration" || ( bodyElement.type === "DeclareExportDeclaration" && @@ -32,8 +37,8 @@ const exportSuggestions = { interface: "export interface", }; -export default (superClass) => class extends superClass { - flowParseTypeInitialiser(tok) { +export default (superClass: Class): Class => class extends superClass { + flowParseTypeInitialiser(tok?: TokenType): N.FlowType { const oldInType = this.state.inType; this.state.inType = true; this.expect(tok || tt.colon); @@ -43,7 +48,7 @@ export default (superClass) => class extends superClass { return type; } - flowParsePredicate() { + flowParsePredicate() : N.FlowType { const node = this.startNode(); const moduloLoc = this.state.startLoc; const moduloPos = this.state.start; @@ -63,7 +68,7 @@ export default (superClass) => class extends superClass { } } - flowParseTypeAndPredicateInitialiser() { + flowParseTypeAndPredicateInitialiser(): [?N.FlowType, ?N.FlowPredicate] { const oldInType = this.state.inType; this.state.inType = true; this.expect(tt.colon); @@ -82,13 +87,13 @@ export default (superClass) => class extends superClass { return [type, predicate]; } - flowParseDeclareClass(node) { + flowParseDeclareClass(node: N.FlowDeclareClass): N.FlowDeclareClass { this.next(); this.flowParseInterfaceish(node); return this.finishNode(node, "DeclareClass"); } - flowParseDeclareFunction(node) { + flowParseDeclareFunction(node: N.FlowDeclareFunction): N.FlowDeclareFunction { this.next(); const id = node.id = this.parseIdentifier(); @@ -108,6 +113,7 @@ export default (superClass) => class extends superClass { typeNode.rest = tmp.rest; this.expect(tt.parenR); + // $FlowFixMe (destructuring not supported yet) [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); @@ -120,7 +126,7 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "DeclareFunction"); } - flowParseDeclare(node, insideModule) { + flowParseDeclare(node: N.FlowDeclare, insideModule?: boolean): N.FlowDeclare { if (this.match(tt._class)) { return this.flowParseDeclareClass(node); } else if (this.match(tt._function)) { @@ -141,18 +147,18 @@ export default (superClass) => class extends superClass { } else if (this.match(tt._export)) { return this.flowParseDeclareExportDeclaration(node, insideModule); } else { - this.unexpected(); + throw this.unexpected(); } } - flowParseDeclareVariable(node) { + flowParseDeclareVariable(node: N.FlowDeclareVariable): N.FlowDeclareVariable { this.next(); node.id = this.flowParseTypeAnnotatableIdentifier(); this.semicolon(); return this.finishNode(node, "DeclareVariable"); } - flowParseDeclareModule(node) { + flowParseDeclareModule(node: N.FlowDeclareModule): N.FlowDeclareModule { this.next(); if (this.match(tt.string)) { @@ -205,7 +211,7 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "DeclareModule"); } - flowParseDeclareExportDeclaration(node, insideModule) { + flowParseDeclareExportDeclaration(node: N.FlowDeclareExportDeclaration, insideModule: ?boolean): N.FlowDeclareExportDeclaration { this.expect(tt._export); if (this.eat(tt._default)) { @@ -252,21 +258,24 @@ export default (superClass) => class extends superClass { node = this.parseExport(node); if (node.type === "ExportNamedDeclaration") { // flow does not support the ExportNamedDeclaration + // $FlowIgnore node.type = "ExportDeclaration"; + // $FlowFixMe node.default = false; delete node.exportKind; } + // $FlowIgnore node.type = "Declare" + node.type; return node; } } - this.unexpected(); + throw this.unexpected(); } - flowParseDeclareModuleExports(node) { + flowParseDeclareModuleExports(node: N.FlowDeclareModuleExports): N.FlowDeclareModuleExports { this.expectContextual("module"); this.expect(tt.dot); this.expectContextual("exports"); @@ -276,13 +285,13 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "DeclareModuleExports"); } - flowParseDeclareTypeAlias(node) { + flowParseDeclareTypeAlias(node: N.FlowDeclareTypeAlias): N.FlowDeclareTypeAlias { this.next(); this.flowParseTypeAlias(node); return this.finishNode(node, "DeclareTypeAlias"); } - flowParseDeclareInterface(node) { + flowParseDeclareInterface(node: N.FlowDeclareInterface): N.FlowDeclareInterface { this.next(); this.flowParseInterfaceish(node); return this.finishNode(node, "DeclareInterface"); @@ -290,7 +299,7 @@ export default (superClass) => class extends superClass { // Interfaces - flowParseInterfaceish(node) { + flowParseInterfaceish(node: N.FlowDeclare): void { node.id = this.parseIdentifier(); if (this.isRelational("<")) { @@ -318,7 +327,7 @@ export default (superClass) => class extends superClass { node.body = this.flowParseObjectType(true, false, false); } - flowParseInterfaceExtends() { + flowParseInterfaceExtends(): N.FlowInterfaceExtends { const node = this.startNode(); node.id = this.flowParseQualifiedTypeIdentifier(); @@ -331,12 +340,12 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "InterfaceExtends"); } - flowParseInterface(node) { + flowParseInterface(node: N.FlowInterface): N.FlowInterface { this.flowParseInterfaceish(node); return this.finishNode(node, "InterfaceDeclaration"); } - flowParseRestrictedIdentifier(liberal) { + flowParseRestrictedIdentifier(liberal?: boolean): N.Identifier { if (primitiveTypes.indexOf(this.state.value) > -1) { this.raise(this.state.start, `Cannot overwrite primitive type ${this.state.value}`); } @@ -346,7 +355,7 @@ export default (superClass) => class extends superClass { // Type aliases - flowParseTypeAlias(node) { + flowParseTypeAlias(node: N.FlowTypeAlias): N.FlowTypeAlias { node.id = this.flowParseRestrictedIdentifier(); if (this.isRelational("<")) { @@ -363,7 +372,7 @@ export default (superClass) => class extends superClass { // Type annotations - flowParseTypeParameter() { + flowParseTypeParameter(): N.FlowTypeParameter { const node = this.startNode(); const variance = this.flowParseVariance(); @@ -381,7 +390,7 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "TypeParameter"); } - flowParseTypeParameterDeclaration() { + flowParseTypeParameterDeclaration(): N.FlowTypeParameterDeclaration { const oldInType = this.state.inType; const node = this.startNode(); node.params = []; @@ -408,7 +417,7 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "TypeParameterDeclaration"); } - flowParseTypeParameterInstantiation() { + flowParseTypeParameterInstantiation(): N.FlowTypeParameterInstantiation { const node = this.startNode(); const oldInType = this.state.inType; node.params = []; @@ -429,11 +438,11 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "TypeParameterInstantiation"); } - flowParseObjectPropertyKey() { + flowParseObjectPropertyKey(): N.Expression { return (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); } - flowParseObjectTypeIndexer(node, isStatic, variance) { + flowParseObjectTypeIndexer(node: N.FlowObjectTypeIndexer, isStatic: boolean, variance: ?N.FlowVariance): N.FlowObjectTypeIndexer { node.static = isStatic; this.expect(tt.bracketL); @@ -451,7 +460,7 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "ObjectTypeIndexer"); } - flowParseObjectTypeMethodish(node) { + flowParseObjectTypeMethodish(node: N.FlowFunctionTypeAnnotation): N.FlowFunctionTypeAnnotation { node.params = []; node.rest = null; node.typeParameters = null; @@ -477,14 +486,14 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "FunctionTypeAnnotation"); } - flowParseObjectTypeCallProperty(node, isStatic) { + flowParseObjectTypeCallProperty(node: N.FlowObjectTypeCallProperty, isStatic: boolean): N.FlowObjectTypeCallProperty { const valueNode = this.startNode(); node.static = isStatic; node.value = this.flowParseObjectTypeMethodish(valueNode); return this.finishNode(node, "ObjectTypeCallProperty"); } - flowParseObjectType(allowStatic, allowExact, allowSpread) { + flowParseObjectType(allowStatic: boolean, allowExact: boolean, allowSpread: boolean): N.FlowObjectTypeAnnotation { const oldInType = this.state.inType; this.state.inType = true; @@ -555,7 +564,13 @@ export default (superClass) => class extends superClass { return out; } - flowParseObjectTypeProperty(node, isStatic, variance, kind, allowSpread) { + flowParseObjectTypeProperty( + node: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty, + isStatic: boolean, + variance: ?N.FlowVariance, + kind: string, + allowSpread: boolean, + ): N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty { if (this.match(tt.ellipsis)) { if (!allowSpread) { this.unexpected( @@ -602,7 +617,7 @@ export default (superClass) => class extends superClass { // This is similar to checkGetterSetterParamCount, but as // babylon uses non estree properties we cannot reuse it here - flowCheckGetterSetterParamCount(property) { + flowCheckGetterSetterParamCount(property: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty): void { const paramCount = property.kind === "get" ? 0 : 1; if (property.value.params.length !== paramCount) { const start = property.start; @@ -614,14 +629,14 @@ export default (superClass) => class extends superClass { } } - flowObjectTypeSemicolon() { + flowObjectTypeSemicolon(): void { if (!this.eat(tt.semi) && !this.eat(tt.comma) && !this.match(tt.braceR) && !this.match(tt.braceBarR)) { this.unexpected(); } } - flowParseQualifiedTypeIdentifier(startPos, startLoc, id) { + flowParseQualifiedTypeIdentifier(startPos?: number, startLoc?: Position, id?: N.Identifier): N.FlowQualifiedTypeIdentifier { startPos = startPos || this.state.start; startLoc = startLoc || this.state.startLoc; let node = id || this.parseIdentifier(); @@ -636,7 +651,7 @@ export default (superClass) => class extends superClass { return node; } - flowParseGenericType(startPos, startLoc, id) { + flowParseGenericType(startPos: number, startLoc: Position, id: N.Identifier): N.FlowGenericTypeAnnotation { const node = this.startNodeAt(startPos, startLoc); node.typeParameters = null; @@ -649,14 +664,14 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "GenericTypeAnnotation"); } - flowParseTypeofType() { + flowParseTypeofType(): N.FlowTypeofTypeAnnotation { const node = this.startNode(); this.expect(tt._typeof); node.argument = this.flowParsePrimaryType(); return this.finishNode(node, "TypeofTypeAnnotation"); } - flowParseTupleType() { + flowParseTupleType(): N.FlowTupleTypeAnnotation { const node = this.startNode(); node.types = []; this.expect(tt.bracketL); @@ -670,7 +685,7 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "TupleTypeAnnotation"); } - flowParseFunctionTypeParam() { + flowParseFunctionTypeParam(): N.FlowFunctionTypeParam { let name = null; let optional = false; let typeAnnotation = null; @@ -692,7 +707,7 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "FunctionTypeParam"); } - reinterpretTypeAsFunctionTypeParam(type) { + reinterpretTypeAsFunctionTypeParam(type: N.FlowType): N.FlowFunctionTypeParam { const node = this.startNodeAt(type.start, type.loc); node.name = null; node.optional = false; @@ -700,21 +715,21 @@ export default (superClass) => class extends superClass { return this.finishNode(node, "FunctionTypeParam"); } - flowParseFunctionTypeParams(params = []) { - const ret = { params, rest: null }; + flowParseFunctionTypeParams(params: N.FlowFunctionTypeParam[] = []): { params: N.FlowFunctionTypeParam[], rest: ?N.FlowFunctionTypeParam } { + let rest: ?N.FlowFunctionTypeParam = null; while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) { - ret.params.push(this.flowParseFunctionTypeParam()); + params.push(this.flowParseFunctionTypeParam()); if (!this.match(tt.parenR)) { this.expect(tt.comma); } } if (this.eat(tt.ellipsis)) { - ret.rest = this.flowParseFunctionTypeParam(); + rest = this.flowParseFunctionTypeParam(); } - return ret; + return { params, rest }; } - flowIdentToTypeAnnotation(startPos, startLoc, node, id) { + flowIdentToTypeAnnotation(startPos: number, startLoc: Position, node: N.FlowTypeAnnotation, id: N.Identifier): N.FlowTypeAnnotation { switch (id.name) { case "any": return this.finishNode(node, "AnyTypeAnnotation"); @@ -746,7 +761,7 @@ export default (superClass) => class extends superClass { // The parsing of types roughly parallels the parsing of expressions, and // primary types are kind of like primary expressions...they're the // primitives with which other types are constructed. - flowParsePrimaryType() { + flowParsePrimaryType(): N.FlowTypeAnnotation { const startPos = this.state.start; const startLoc = this.state.startLoc; const node = this.startNode(); @@ -876,10 +891,10 @@ export default (superClass) => class extends superClass { } } - this.unexpected(); + throw this.unexpected(); } - flowParsePostfixType() { + flowParsePostfixType(): N.FlowTypeAnnotation { const startPos = this.state.start, startLoc = this.state.startLoc; let type = this.flowParsePrimaryType(); while (!this.canInsertSemicolon() && this.match(tt.bracketL)) { @@ -892,7 +907,7 @@ export default (superClass) => class extends superClass { return type; } - flowParsePrefixType() { + flowParsePrefixType(): N.FlowTypeAnnotation { const node = this.startNode(); if (this.eat(tt.question)) { node.typeAnnotation = this.flowParsePrefixType(); @@ -902,9 +917,10 @@ export default (superClass) => class extends superClass { } } - flowParseAnonFunctionWithoutParens() { + flowParseAnonFunctionWithoutParens(): N.FlowTypeAnnotation { const param = this.flowParsePrefixType(); if (!this.state.noAnonFunctionType && this.eat(tt.arrow)) { + // TODO: This should be a type error. Passing in a SourceLocation, and it expects a Position. const node = this.startNodeAt(param.start, param.loc); node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; node.rest = null; @@ -915,7 +931,7 @@ export default (superClass) => class extends superClass { return param; } - flowParseIntersectionType() { + flowParseIntersectionType(): N.FlowTypeAnnotation { const node = this.startNode(); this.eat(tt.bitwiseAND); const type = this.flowParseAnonFunctionWithoutParens(); @@ -926,7 +942,7 @@ export default (superClass) => class extends superClass { return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); } - flowParseUnionType() { + flowParseUnionType(): N.FlowTypeAnnotation { const node = this.startNode(); this.eat(tt.bitwiseOR); const type = this.flowParseIntersectionType(); @@ -937,7 +953,7 @@ export default (superClass) => class extends superClass { return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); } - flowParseType() { + flowParseType(): N.FlowTypeAnnotation { const oldInType = this.state.inType; this.state.inType = true; const type = this.flowParseUnionType(); @@ -945,13 +961,13 @@ export default (superClass) => class extends superClass { return type; } - flowParseTypeAnnotation() { + flowParseTypeAnnotation(): N.FlowTypeAnnotation { const node = this.startNode(); node.typeAnnotation = this.flowParseTypeInitialiser(); return this.finishNode(node, "TypeAnnotation"); } - flowParseTypeAnnotatableIdentifier() { + flowParseTypeAnnotatableIdentifier(): N.Identifier { const ident = this.flowParseRestrictedIdentifier(); if (this.match(tt.colon)) { ident.typeAnnotation = this.flowParseTypeAnnotation(); @@ -960,7 +976,7 @@ export default (superClass) => class extends superClass { return ident; } - typeCastToParameter(node) { + typeCastToParameter(node: N.Node): N.Node { node.expression.typeAnnotation = node.typeAnnotation; return this.finishNodeAt( @@ -971,7 +987,7 @@ export default (superClass) => class extends superClass { ); } - flowParseVariance() { + flowParseVariance(): ?N.FlowVariance { let variance = null; if (this.match(tt.plusMin)) { variance = this.startNode(); @@ -991,11 +1007,12 @@ export default (superClass) => class extends superClass { // ================================== // plain function return types: function name(): string {} - parseFunctionBody(node, allowExpression) { + parseFunctionBody(node: N.Function, allowExpression?: boolean): void { if (this.match(tt.colon) && !allowExpression) { // if allowExpression is true then we're parsing an arrow function and if // there's a return type then it's been handled elsewhere const typeNode = this.startNode(); + // $FlowFixMe (destructuring not yet supported) [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); node.returnType = typeNode.typeAnnotation @@ -1007,7 +1024,7 @@ export default (superClass) => class extends superClass { } // interfaces - parseStatement(declaration, topLevel) { + parseStatement(declaration: boolean, topLevel?: boolean): N.Statement { // strict mode handling of `interface` since it's a reserved word if (this.state.strict && this.match(tt.name) && this.state.value === "interface") { const node = this.startNode(); @@ -1019,7 +1036,7 @@ export default (superClass) => class extends superClass { } // declares, interfaces and type aliases - parseExpressionStatement(node, expr) { + parseExpressionStatement(node: N.ExpressionStatement, expr: N.Expression): N.ExpressionStatement { if (expr.type === "Identifier") { if (expr.name === "declare") { if (this.match(tt._class) || this.match(tt.name) || this.match(tt._function) || this.match(tt._var) || this.match(tt._export)) { @@ -1038,13 +1055,13 @@ export default (superClass) => class extends superClass { } // export type - shouldParseExportDeclaration() { + shouldParseExportDeclaration(): boolean { return this.isContextual("type") || this.isContextual("interface") || super.shouldParseExportDeclaration(); } - parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) { + parseConditional(expr: N.Expression, noIn: ?boolean, startPos: number, startLoc: Position, refNeedsArrowPos?: Pos): N.Expression { // only do the expensive clone if there is a question mark // and if we come from inside parens if (refNeedsArrowPos && this.match(tt.question)) { @@ -1066,7 +1083,7 @@ export default (superClass) => class extends superClass { return super.parseConditional(expr, noIn, startPos, startLoc); } - parseParenItem(node, startPos, startLoc) { + parseParenItem(node: N.Expression, startPos: number, startLoc: Position): N.Expression { node = super.parseParenItem(node, startPos, startLoc); if (this.eat(tt.question)) { node.optional = true; @@ -1083,7 +1100,7 @@ export default (superClass) => class extends superClass { return node; } - parseExport(node) { + parseExport(node: N.ExportNamedDeclaration): N.ExportNamedDeclaration { node = super.parseExport(node); if (node.type === "ExportNamedDeclaration") { node.exportKind = node.exportKind || "value"; @@ -1091,7 +1108,7 @@ export default (superClass) => class extends superClass { return node; } - parseExportDeclaration(node) { + parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration { if (this.isContextual("type")) { node.exportKind = "type"; @@ -1117,7 +1134,7 @@ export default (superClass) => class extends superClass { } } - parseClassId(node, ...args) { + parseClassId(node: N.Class, ...args) { super.parseClassId(node, ...args); if (this.isRelational("<")) { node.typeParameters = this.flowParseTypeParameterDeclaration(); @@ -1126,7 +1143,7 @@ export default (superClass) => class extends superClass { // don't consider `void` to be a keyword as then it'll use the void token type // and set startExpr - isKeyword(name) { + isKeyword(name: string): boolean { if (this.state.inType && name === "void") { return false; } else { @@ -1135,7 +1152,7 @@ export default (superClass) => class extends superClass { } // ensure that inside flow types, we bypass the jsx parser plugin - readToken(code) { + readToken(code: number): void { if (this.state.inType && (code === 62 || code === 60)) { return this.finishOp(tt.relational, 1); } else { @@ -1143,12 +1160,7 @@ export default (superClass) => class extends superClass { } } - // don't lex any token as a jsx one inside a flow type - jsx_readToken() { - if (!this.state.inType) return super.jsx_readToken(); - } - - toAssignable(node, isBinding, contextDescription) { + toAssignable(node: N.Node, isBinding: ?boolean, contextDescription: string): N.Node { if (node.type === "TypeCastExpression") { return super.toAssignable(this.typeCastToParameter(node), isBinding, contextDescription); } else { @@ -1157,7 +1169,7 @@ export default (superClass) => class extends superClass { } // turn type casts that we found in function parameter head into type annotated params - toAssignableList(exprList, isBinding, contextDescription) { + toAssignableList(exprList: N.Expression[], isBinding: ?boolean, contextDescription: string): $ReadOnlyArray { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if (expr && expr.type === "TypeCastExpression") { @@ -1169,7 +1181,7 @@ export default (superClass) => class extends superClass { // this is a list of nodes, from something like a call expression, we need to filter the // type casts that we've found that are illegal in this context - toReferencedList(exprList) { + toReferencedList(exprList: $ReadOnlyArray): $ReadOnlyArray { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if (expr && expr._exprListItem && expr.type === "TypeCastExpression") { @@ -1182,7 +1194,7 @@ export default (superClass) => class extends superClass { // parse an item inside a expression list eg. `(NODE, NODE)` where NODE represents // the position where this function is called - parseExprListItem(...args) { + parseExprListItem(...args): ?N.Expression { const container = this.startNode(); const node = super.parseExprListItem(...args); if (this.match(tt.colon)) { @@ -1195,14 +1207,14 @@ export default (superClass) => class extends superClass { } } - checkLVal(node, ...args) { + checkLVal(node: N.Expression, ...args): void { if (node.type !== "TypeCastExpression") { return super.checkLVal(node, ...args); } } // parse class property type annotations - parseClassProperty(node) { + parseClassProperty(node: N.ClassProperty): N.ClassProperty { if (this.match(tt.colon)) { node.typeAnnotation = this.flowParseTypeAnnotation(); } @@ -1210,17 +1222,17 @@ export default (superClass) => class extends superClass { } // determine whether or not we're currently in the position where a class method would appear - isClassMethod() { + isClassMethod(): boolean { return this.isRelational("<") || super.isClassMethod(); } // determine whether or not we're currently in the position where a class property would appear - isClassProperty() { + isClassProperty(): boolean { return this.match(tt.colon) || super.isClassProperty(); } // parse type parameters for class methods - parseClassMethod(classBody, method, ...args) { + parseClassMethod(classBody: N.ClassBody, method: N.ClassMethod, ...args): void { if (method.variance) { this.unexpected(method.variance.start); } @@ -1233,7 +1245,7 @@ export default (superClass) => class extends superClass { } // parse a the super class type parameters and implements - parseClassSuper(node, isStatement) { + parseClassSuper(node: N.Class, isStatement?: boolean): void { super.parseClassSuper(node, isStatement); if (node.superClass && this.isRelational("<")) { node.superTypeParameters = this.flowParseTypeParameterInstantiation(); @@ -1254,7 +1266,7 @@ export default (superClass) => class extends superClass { } } - parsePropertyName(node) { + parsePropertyName(node: N.ObjectMember): N.Identifier { const variance = this.flowParseVariance(); const key = super.parsePropertyName(node); node.variance = variance; @@ -1262,7 +1274,7 @@ export default (superClass) => class extends superClass { } // parse type parameters for object method shorthand - parseObjPropValue(prop, ...args) { + parseObjPropValue(prop: N.ObjectMember, ...args): void { if (prop.variance) { this.unexpected(prop.variance.start); } @@ -1280,11 +1292,12 @@ export default (superClass) => class extends superClass { // add typeParameters if we found them if (typeParameters) { + // $FlowFixMe (trying to set '.typeParameters' on an expression) (prop.value || prop).typeParameters = typeParameters; } } - parseAssignableListItemTypes(param) { + parseAssignableListItemTypes(param: N.Pattern): N.Pattern { if (this.eat(tt.question)) { param.optional = true; } @@ -1295,7 +1308,7 @@ export default (superClass) => class extends superClass { return param; } - parseMaybeDefault(...args) { + parseMaybeDefault(...args): N.Pattern { const node = super.parseMaybeDefault(...args); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { @@ -1306,7 +1319,7 @@ export default (superClass) => class extends superClass { } // parse typeof and type imports - parseImportSpecifiers(node) { + parseImportSpecifiers(node: N.ImportDeclaration): void { node.importKind = "value"; let kind = null; @@ -1327,7 +1340,7 @@ export default (superClass) => class extends superClass { } // parse import-type/typeof shorthand - parseImportSpecifier(node) { + parseImportSpecifier(node: N.ImportDeclaration): void { const specifier = this.startNode(); const firstIdentLoc = this.state.start; const firstIdent = this.parseIdentifier(true); @@ -1384,7 +1397,7 @@ export default (superClass) => class extends superClass { } // parse function type parameters - function foo() {} - parseFunctionParams(node) { + parseFunctionParams(node: N.NormalFunction): void { if (this.isRelational("<")) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } @@ -1392,7 +1405,7 @@ export default (superClass) => class extends superClass { } // parse flow type annotations on variable declarator heads - let foo: string = bar - parseVarHead(decl) { + parseVarHead(decl: N.VariableDeclarator): void { super.parseVarHead(decl); if (this.match(tt.colon)) { decl.id.typeAnnotation = this.flowParseTypeAnnotation(); @@ -1401,7 +1414,7 @@ export default (superClass) => class extends superClass { } // parse the return type of an async arrow function - let foo = (async (): number => {}); - parseAsyncArrowFromCallExpression(node, call) { + parseAsyncArrowFromCallExpression(node: N.ArrowFunctionExpression, call: N.CallExpression): N.ArrowFunctionExpression { if (this.match(tt.colon)) { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; @@ -1413,7 +1426,7 @@ export default (superClass) => class extends superClass { } // todo description - shouldParseAsyncArrow() { + shouldParseAsyncArrow(): boolean { return this.match(tt.colon) || super.shouldParseAsyncArrow(); } @@ -1427,7 +1440,7 @@ export default (superClass) => class extends superClass { // parse the rest, make sure the rest is an arrow function, and go from // there // 3. This is neither. Just call the super method - parseMaybeAssign(...args) { + parseMaybeAssign(...args): N.Expression { let jsxError = null; if (tt.jsxTagStart && this.match(tt.jsxTagStart)) { const state = this.state.clone(); @@ -1479,7 +1492,7 @@ export default (superClass) => class extends superClass { } // handle return types for arrow functions - parseArrow(node) { + parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression { if (this.match(tt.colon)) { const state = this.state.clone(); try { @@ -1487,6 +1500,7 @@ export default (superClass) => class extends superClass { this.state.noAnonFunctionType = true; const typeNode = this.startNode(); + // $FlowFixMe (destructuring not supported yet) [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); this.state.noAnonFunctionType = oldNoAnonFunctionType; @@ -1511,7 +1525,7 @@ export default (superClass) => class extends superClass { return super.parseArrow(node); } - shouldParseArrow() { + shouldParseArrow(): boolean { return this.match(tt.colon) || super.shouldParseArrow(); } }; diff --git a/src/types.js b/src/types.js index d7d4f388f5..b42f72a154 100644 --- a/src/types.js +++ b/src/types.js @@ -489,6 +489,7 @@ export type TemplateElement = NodeBase & { export type PatternBase = HasDecorators & { // Flow only: + optional?: true; typeAnnotation?: ?FlowTypeAnnotation; }; @@ -679,6 +680,7 @@ export type FlowType = Node; export type FlowPredicate = Node; export type FlowDeclare = Node; export type FlowDeclareClass = Node; +export type FlowDeclareExportDeclaration = Node; export type FlowDeclareFunction = Node; export type FlowDeclareVariable = Node; export type FlowDeclareModule = Node; @@ -694,6 +696,7 @@ export type FlowTypeParameterInstantiation = Node; export type FlowObjectTypeIndexer = Node; export type FlowFunctionTypeAnnotation = Node; export type FlowObjectTypeProperty = Node; +export type FlowObjectTypeSpreadProperty = Node; export type FlowObjectTypeCallProperty = Node; export type FlowObjectTypeAnnotation = Node; export type FlowQualifiedTypeIdentifier = Node;