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/.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/.travis.yml b/.travis.yml index e1d38de890..eb22eaf9c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,48 +1,43 @@ 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 +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' - # Switch back to node version currently being tested prior to test run - - 'nvm use $TRAVIS_NODE_VERSION;' + - '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/CHANGELOG.md b/CHANGELOG.md index bb482fc5c7..b7a486500a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,125 @@ _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. +## 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) +* 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) +- 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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5130b2c078..eefd2e2706 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 @@ -19,25 +23,45 @@ npm install 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 + +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 +yarn run test-only +``` + ### Checking code coverage locally To generate code coverage, be sure to set `BABEL_ENV=test` so that code is instrumented during 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 @@ -61,19 +85,21 @@ 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 -cd ../../packages/babel-template/ -npm link babylon -cd ../../packages/babel-traverse/ -npm link babylon -cd ../../packages/babel-generator/ -npm link babylon +yarn link babylon +cd ../babel-template/ +yarn link babylon +cd ../babel-traverse/ +yarn link babylon +cd ../babel-generator/ +yarn link babylon +cd ../babel-types/ +yarn link babylon cd ../.. make build make test diff --git a/Makefile b/Makefile index 22e088f90a..351fc07848 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 --compilers js:babel-register; \ bootstrap-flow: clean mkdir ./build diff --git a/ast/spec.md b/ast/spec.md index 9e2e094b9f..0ff1c87c51 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) @@ -35,7 +36,6 @@ These are the core Babylon AST node types. - [ForStatement](#forstatement) - [ForInStatement](#forinstatement) - [ForOfStatement](#forofstatement) - - [ForAwaitStatement](#forawaitstatement) - [Declarations](#declarations) - [FunctionDeclaration](#functiondeclaration) - [VariableDeclaration](#variabledeclaration) @@ -56,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) @@ -78,6 +76,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) @@ -140,6 +139,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 @@ -478,16 +493,7 @@ A `for`/`in` statement. ```js interface ForOfStatement <: ForInStatement { type: "ForOfStatement"; -} -``` - -A `for`/`await` statement. - -## ForAwaitStatement - -```js -interface ForAwaitStatement <: ForInStatement { - type: "ForAwaitStatement"; + await: boolean; } ``` @@ -651,7 +657,7 @@ An array expression. ```js interface ObjectExpression <: Expression { type: "ObjectExpression"; - properties: [ ObjectProperty | ObjectMethod | SpreadProperty ]; + properties: [ ObjectProperty | ObjectMethod | SpreadElement ]; } ``` @@ -663,7 +669,6 @@ An object expression. interface ObjectMember <: Node { key: Expression; computed: boolean; - value: Expression; decorators: [ Decorator ]; } ``` @@ -674,6 +679,7 @@ interface ObjectMember <: Node { interface ObjectProperty <: ObjectMember { type: "ObjectProperty"; shorthand: boolean; + value: Expression; } ``` @@ -686,24 +692,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 @@ -920,6 +908,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 @@ -949,7 +946,7 @@ interface TemplateElement <: Node { type: "TemplateElement"; tail: boolean; value: { - cooked: string; + cooked: string | null; raw: string; }; } @@ -970,7 +967,7 @@ interface AssignmentProperty <: ObjectProperty { interface ObjectPattern <: Pattern { type: "ObjectPattern"; - properties: [ AssignmentProperty | RestProperty ]; + properties: [ AssignmentProperty | RestElement ]; } ``` @@ -1025,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; diff --git a/package.json b/package.json index 4345e7b873..c1c7b9288f 100644 --- a/package.json +++ b/package.json @@ -18,28 +18,31 @@ "bin", "lib" ], + "engines": { + "node": ">=4.2.0" + }, "devDependencies": { - "ava": "^0.17.0", - "babel-cli": "^6.14.0", + "ava": "^0.19.0", + "babel-cli": "^7.0.0-alpha.6", "babel-eslint": "^7.0.0", - "babel-helper-fixtures": "^6.9.0", - "babel-plugin-istanbul": "^3.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-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": "^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", - "codecov": "^1.0.1", - "cross-env": "^2.0.0", + "cross-env": "^4.0.0", "eslint": "^3.7.1", "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.20.0", - "flow-bin": "^0.40.0", + "flow-bin": "^0.44.0", "nyc": "^10.0.0", "rimraf": "^2.5.4", "rollup": "^0.41.0", "rollup-plugin-babel": "^2.6.1", - "rollup-plugin-node-resolve": "^2.0.0", - "try-resolve": "^1.0.1", + "rollup-plugin-node-resolve": "^3.0.0", + "rollup-watch": "^3.2.2", "unicode-9.0.0": "~0.7.0" }, "bin": { @@ -47,18 +50,17 @@ "babylon-lightscript": "./bin/babylon-lightscript.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 && cross-env BABEL_ENV=watch babel src --out-dir lib --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": [ @@ -76,10 +78,5 @@ "src/**/*.js", "bin/**/*.js" ] - }, - "greenkeeper": { - "ignore": [ - "cross-env" - ] } } 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/src/index.js b/src/index.js index 7e4285c809..7619b50577 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 lightscriptPlugin from "./plugins/lightscript"; import estreePlugin from "./plugins/estree"; import flowPlugin from "./plugins/flow"; @@ -20,12 +25,12 @@ plugins.estree = estreePlugin; plugins.flow = flowPlugin; plugins.jsx = jsxPlugin; -export function parse(input, options) { - return new Parser(options, input).parse(); +export function parse(input: string, options?: Options): File { + return getParser(options, input).parse(); } -export function parseExpression(input, options) { - const parser = new Parser(options, input); +export function parseExpression(input: string, options?: Options): Expression { + const parser = getParser(options, input); if (parser.options.strictMode) { parser.state.strict = true; } @@ -34,3 +39,41 @@ export function parseExpression(input, options) { export { tokTypes }; + +function getParser(options: ?Options, input: string): Parser { + const cls = options && options.plugins ? getParserClass(options.plugins) : Parser; + return new cls(options, input); +} + +const parserClassCache: { [key: string]: Class } = {}; + +/** Get a Parser class with plugins applied. */ +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" || p === "lightscript" + ); + + 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/options.js b/src/options.js index 72c65f34a6..72d65ed0df 100755 --- a/src/options.js +++ b/src/options.js @@ -1,16 +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 -} = { +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. @@ -30,12 +35,21 @@ 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 -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/base.js b/src/parser/base.js new file mode 100644 index 0000000000..3795b71668 --- /dev/null +++ b/src/parser/base.js @@ -0,0 +1,31 @@ +// @flow + +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; + inModule: boolean; + plugins: { [key: string]: boolean }; + filename: ?string; + + // Initialized by Tokenizer + state: State; + input: 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..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. * @@ -24,133 +26,132 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import Parser from "./index"; +import BaseParser from "./base"; +import type { Comment, Node } from "../types"; 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: Comment): void { + 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: Node): void { + 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; - } - // 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; + // 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. + 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. + 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 a1a5b384be..368f80d71e 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -19,1364 +19,1377 @@ // [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; - } -}; - -// Convenience method to parse an Expression only -pp.getExpression = function() { - this.nextToken(); - const expr = this.parseExpression(); - if (!this.match(tt.eof)) { - this.unexpected(); - } - 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)); + if (name === "__proto__") { + if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); + propHash.proto = true; } - this.toReferencedList(node.expressions); - return this.finishNode(node, "SequenceExpression"); } - return expr; -}; -// 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; - - if (this.match(tt._yield) && this.state.inGenerator) { - let left = this.parseYield(); - if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); - return left; + // Convenience method to parse an Expression only + getExpression() { + this.nextToken(); + const expr = this.parseExpression(); + if (!this.match(tt.eof)) { + this.unexpected(); + } + return expr; } - let failOnShorthandAssign; - if (refShorthandDefaultPos) { - failOnShorthandAssign = false; - } else { - refShorthandDefaultPos = { start: 0 }; - failOnShorthandAssign = true; + // ### 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"); + } + return expr; } - if (this.match(tt.parenL) || this.match(tt.name)) { - this.state.potentialArrowAt = this.state.start; - } + // Parse an assignment expression. This includes applications of + // operators like `+=`. - let leftStartsLine, isNowAssign; - if (this.hasPlugin("lightscript")) { - leftStartsLine = this.seemsLikeStatementStart(); - isNowAssign = this.eat(tt._now); - } + parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) { + const startPos = this.state.start; + const startLoc = this.state.startLoc; - let left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos); - if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); - - // `varName: type = val`, with unwinding - // (this is a likely source of ambiguities, bugs, etc, since whitespace-block colons and others may be interpreted as type decaration) - let typeAnnotation; - if (this.hasPlugin("lightscript") && this.hasPlugin("flow") && this.match(tt.colon) && !this.isFollowedByLineBreak() && leftStartsLine) { - const state = this.state.clone(); - try { - typeAnnotation = this.flowParseTypeAnnotation(); - } catch (err) { - this.state = state; + if (this.match(tt._yield) && this.state.inGenerator) { + let left = this.parseYield(); + if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); + return left; } - // if it's not followed by `=` after all, unwind - if (!(this.match(tt.eq) || this.match(tt.awaitArrow))) { - this.state = state; + let failOnShorthandAssign; + if (refShorthandDefaultPos) { + failOnShorthandAssign = false; + } else { + refShorthandDefaultPos = { start: 0 }; + failOnShorthandAssign = true; } - } - if (this.state.type.isAssign) { - const node = this.startNodeAt(startPos, startLoc); - node.operator = this.state.value; - - // `or` -> `||` etc. - if (this.hasPlugin("lightscript")) this.rewriteOperator(node); - - const isAwaitArrow = this.hasPlugin("lightscript") && this.match(tt.awaitArrow); - if (isAwaitArrow && this.isLineBreak()) return left; + if (this.match(tt.parenL) || this.match(tt.name)) { + this.state.potentialArrowAt = this.state.start; + } - node.left = this.match(tt.eq) || isAwaitArrow ? this.toAssignable(left, undefined, "assignment expression") : left; - refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly + let leftStartsLine, isNowAssign; + if (this.hasPlugin("lightscript")) { + leftStartsLine = this.seemsLikeStatementStart(); + isNowAssign = this.eat(tt._now); + } - this.checkLVal(left, undefined, undefined, "assignment expression"); + let left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos); + if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); - 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)`"; + // `varName: type = val`, with unwinding + // (this is a likely source of ambiguities, bugs, etc, since whitespace-block colons and others may be interpreted as type decaration) + let typeAnnotation; + if (this.hasPlugin("lightscript") && this.hasPlugin("flow") && this.match(tt.colon) && !this.isFollowedByLineBreak() && leftStartsLine) { + const state = this.state.clone(); + try { + typeAnnotation = this.flowParseTypeAnnotation(); + } catch (err) { + this.state = state; } - if (errorMsg) { - this.raise(left.start, `You're trying to assign to a parenthesized expression, eg. instead of ${errorMsg}`); + + // if it's not followed by `=` after all, unwind + if (!(this.match(tt.eq) || this.match(tt.awaitArrow))) { + this.state = state; } } - if (typeAnnotation) { - node.left.typeAnnotation = typeAnnotation; - node.left.end = typeAnnotation.end; - node.left.loc.end = typeAnnotation.loc.end; - } + if (this.state.type.isAssign) { + const node = this.startNodeAt(startPos, startLoc); + node.operator = this.state.value; - if (isAwaitArrow) { - node.right = this.parseAwaitArrow(node.left); - } else { - this.next(); - node.right = this.parseMaybeAssign(noIn); - } + // `or` -> `||` etc. + if (this.hasPlugin("lightscript")) this.rewriteOperator(node); - if (this.hasPlugin("lightscript")) { - node.isNowAssign = isNowAssign; - } + const isAwaitArrow = this.hasPlugin("lightscript") && this.match(tt.awaitArrow); + if (isAwaitArrow && this.isLineBreak()) return left; - return this.finishNode(node, "AssignmentExpression"); - } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } + node.left = this.match(tt.eq) || isAwaitArrow ? this.toAssignable(left, undefined, "assignment expression") : left; + refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly - if (this.hasPlugin("lightscript") && isNowAssign) { - if (left.type === "UpdateExpression" || noIn) { - left.isNowAssign = true; - } else { - this.unexpected(left.start, "`now` can only be used with assignments and updates."); - } - } + this.checkLVal(left, undefined, undefined, "assignment expression"); - return left; -}; + 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}`); + } + } -// Parse a ternary conditional (`?:`) operator. + if (typeAnnotation) { + node.left.typeAnnotation = typeAnnotation; + node.left.end = typeAnnotation.end; + node.left.loc.end = typeAnnotation.loc.end; + } -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; + if (isAwaitArrow) { + node.right = this.parseAwaitArrow(node.left); + } else { + this.next(); + node.right = this.parseMaybeAssign(noIn); + } - return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); -}; + if (this.hasPlugin("lightscript")) { + node.isNowAssign = isNowAssign; + } -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"); - } - return expr; -}; + return this.finishNode(node, "AssignmentExpression"); + } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { + this.unexpected(refShorthandDefaultPos.start); + } -// Start the precedence parser. + if (this.hasPlugin("lightscript") && isNowAssign) { + if (left.type === "UpdateExpression" || noIn) { + left.isNowAssign = true; + } else { + this.unexpected(left.start, "`now` can only be used with assignments and updates."); + } + } -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); + return left; } -}; -// 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. + // Parse a ternary conditional (`?:`) operator. -pp.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { - // correct ASI failures. - if (this.hasPlugin("lightscript") && this.isLineBreak()) { + 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; - // if it's a newline followed by a unary +/-, bail so it can be parsed separately. - if (this.match(tt.plusMin) && !this.isNextCharWhitespace()) { - return left; + return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos); + } + + 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; } - if (this.hasPlugin("lightscript") && this.isBitwiseOp()) { - this.unexpected(null, "Bitwise operators have been disabled in LightScript. " + - "Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`)."); + // Start the precedence parser. + + 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); + } } - 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; + // 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. - // `or` -> `||` etc. - if (this.hasPlugin("lightscript")) this.rewriteOperator(node); + parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) { + // correct ASI failures. + if (this.hasPlugin("lightscript") && this.isLineBreak()) { - 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."); + // if it's a newline followed by a unary +/-, bail so it can be parsed separately. + if (this.match(tt.plusMin) && !this.isNextCharWhitespace()) { + return left; } + } - const op = this.state.type; - this.next(); + if (this.hasPlugin("lightscript") && this.isBitwiseOp()) { + this.unexpected(null, "Bitwise operators have been disabled in LightScript. " + + "Use the stdlib functions instead (eg; `bitwiseAnd(a, b)`)."); + } - 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 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; + + // `or` -> `||` etc. + if (this.hasPlugin("lightscript")) this.rewriteOperator(node); + + 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 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) { - if (this.hasPlugin("lightscript") && this.match(tt.plusMin)) { - if (this.isNextCharWhitespace()) this.unexpected(null, "Unary +/- cannot be followed by a space in lightscript."); - } + parseMaybeUnary(refShorthandDefaultPos) { + if (this.state.type.prefix) { + if (this.hasPlugin("lightscript") && this.match(tt.plusMin)) { + if (this.isNextCharWhitespace()) this.unexpected(null, "Unary +/- cannot be followed by a space in lightscript."); + } - const node = this.startNode(); - const update = this.match(tt.incDec); - node.operator = this.state.value; + const node = this.startNode(); + const update = this.match(tt.incDec); + node.operator = this.state.value; - // `not` -> `!` etc. - if (this.hasPlugin("lightscript")) this.rewriteOperator(node); + // `not` -> `!` etc. + if (this.hasPlugin("lightscript")) this.rewriteOperator(node); - node.prefix = true; - this.next(); + 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.match(tt.dot)) { - // require indentation - if (this.hasPlugin("lightscript") && this.isNonIndentedBreakFrom(startPos)) { - if (this.lookahead().type === tt.num) { - this.unexpected(null, "Either indent for array access or use a leading zero for a decimal."); + 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.match(tt.dot)) { + // require indentation + if (this.hasPlugin("lightscript") && this.isNonIndentedBreakFrom(startPos)) { + if (this.lookahead().type === tt.num) { + this.unexpected(null, "Either indent for array access or use a leading zero for a decimal."); + } + this.unexpected(null, "Indentation required."); } - this.unexpected(null, "Indentation required."); - } - // catch malformed decimals (but allow `0.0.toString()`, which is actually valid) - if (this.hasPlugin("lightscript") && base.type === "NumericLiteral") { - if (!(base.extra && base.extra.raw && base.extra.raw.match(/\./))) { - this.unexpected(null, "Numbers with a decimal must end in a number (eg; `1.0`) in LightScript."); + // catch malformed decimals (but allow `0.0.toString()`, which is actually valid) + if (this.hasPlugin("lightscript") && base.type === "NumericLiteral") { + if (!(base.extra && base.extra.raw && base.extra.raw.match(/\./))) { + this.unexpected(null, "Numbers with a decimal must end in a number (eg; `1.0`) in LightScript."); + } } - } - this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.object = base; + this.next(); + const node = this.startNodeAt(startPos, startLoc); + node.object = base; - // parse arr.0 as arr[0] - if (this.hasPlugin("lightscript") && this.match(tt.num)) { - node.property = this.parseExprAtom(); - node.computed = true; - } else { - node.property = this.parseIdentifier(true); - node.computed = false; - } - base = this.finishNode(node, "MemberExpression"); - } else if (this.hasPlugin("lightscript") && this.match(tt.elvis)) { - if (this.isNonIndentedBreakFrom(startPos)) { - this.unexpected(null, "Indentation required."); - } - // `x?.y` - const node = this.startNodeAt(startPos, startLoc); - const op = this.state.value; - this.next(); - node.object = base; - if (op === "?.") { - // arr?.0 -> arr?[0] - if (this.match(tt.num)) { - node.property = this.parseLiteral(this.state.value, "NumericLiteral"); + // parse arr.0 as arr[0] + if (this.hasPlugin("lightscript") && this.match(tt.num)) { + node.property = this.parseExprAtom(); node.computed = true; } else { node.property = this.parseIdentifier(true); node.computed = false; } - } else if (op === "?[") { + base = this.finishNode(node, "MemberExpression"); + } else if (this.hasPlugin("lightscript") && this.match(tt.elvis)) { + if (this.isNonIndentedBreakFrom(startPos)) { + this.unexpected(null, "Indentation required."); + } + // `x?.y` + const node = this.startNodeAt(startPos, startLoc); + const op = this.state.value; + this.next(); + node.object = base; + if (op === "?.") { + // arr?.0 -> arr?[0] + if (this.match(tt.num)) { + node.property = this.parseLiteral(this.state.value, "NumericLiteral"); + node.computed = true; + } else { + node.property = this.parseIdentifier(true); + node.computed = false; + } + } else if (op === "?[") { + node.property = this.parseExpression(); + node.computed = true; + this.expect(tt.bracketR); + } else { + this.unexpected(); + } + base = this.finishNode(node, "SafeMemberExpression"); + } else if (this.hasPlugin("lightscript") && !noCalls && this.match(tt.tilde)) { + if (this.isNonIndentedBreakFrom(startPos)) { + this.unexpected(null, "Indentation required."); + } + this.next(); + const node = this.startNodeAt(startPos, startLoc); + node.left = base; + // allow `this`, Identifier or MemberExpression, but not calls + const right = this.match(tt._this) ? this.parseExprAtom() : this.parseIdentifier(); + node.right = this.parseSubscripts(right, this.state.start, this.state.startLoc, true); + + this.expect(tt.parenL); + node.arguments = this.parseCallExpressionArguments(tt.parenR, false); + base = this.finishNode(node, "TildeCallExpression"); + } else if (!(this.hasPlugin("lightscript") && this.isNonIndentedBreakFrom(startPos)) && this.eat(tt.bracketL)) { + const node = this.startNodeAt(startPos, startLoc); + node.object = base; node.property = this.parseExpression(); node.computed = true; this.expect(tt.bracketR); - } else { - this.unexpected(); - } - base = this.finishNode(node, "SafeMemberExpression"); - } else if (this.hasPlugin("lightscript") && !noCalls && this.match(tt.tilde)) { - if (this.isNonIndentedBreakFrom(startPos)) { - this.unexpected(null, "Indentation required."); - } - this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.left = base; - // allow `this`, Identifier or MemberExpression, but not calls - const right = this.match(tt._this) ? this.parseExprAtom() : this.parseIdentifier(); - node.right = this.parseSubscripts(right, this.state.start, this.state.startLoc, true); - - this.expect(tt.parenL); - node.arguments = this.parseCallExpressionArguments(tt.parenR, false); - base = this.finishNode(node, "TildeCallExpression"); - } else if (!(this.hasPlugin("lightscript") && this.isNonIndentedBreakFrom(startPos)) && 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) && !(this.hasPlugin("lightscript") && this.isLineBreak())) { - const possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon(); - const possibleArrow = possibleAsync || this.hasPlugin("lightscript"); - const refShorthandDefaultPos = possibleArrow ? { start: 0 } : undefined; - this.next(); + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.match(tt.parenL) && !(this.hasPlugin("lightscript") && this.isLineBreak())) { + const possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon(); + const possibleArrow = possibleAsync || this.hasPlugin("lightscript"); + const refShorthandDefaultPos = possibleArrow ? { start: 0 } : undefined; + this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = this.parseCallExpressionArguments(tt.parenR, possibleArrow, refShorthandDefaultPos); - 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); - } else if (this.hasPlugin("lightscript") && this.shouldParseAsyncArrow()) { - - // could be a function call followed by a colon-block, eg `if fn(): blah` - // or an annotated NamedArrowExpression, eg `fn(): blah ->` - // Disambiguating is hard, especially with good error messages... - // TODO: relentlessly test edge cases. - // This is one of the most likely sources of bugs I've encountered yet. - if (this.match(tt.colon)) { - const state = this.state.clone(); - try { + const node = this.startNodeAt(startPos, startLoc); + node.callee = base; + node.arguments = this.parseCallExpressionArguments(tt.parenR, possibleArrow, refShorthandDefaultPos); + 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); + } else if (this.hasPlugin("lightscript") && this.shouldParseAsyncArrow()) { + + // could be a function call followed by a colon-block, eg `if fn(): blah` + // or an annotated NamedArrowExpression, eg `fn(): blah ->` + // Disambiguating is hard, especially with good error messages... + // TODO: relentlessly test edge cases. + // This is one of the most likely sources of bugs I've encountered yet. + if (this.match(tt.colon)) { + const state = this.state.clone(); + try { + return this.parseNamedArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); + } catch (err) { + if (this.match(tt.arrow)) throw err; + this.state = state; + } + } else { return this.parseNamedArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); - } catch (err) { - if (this.match(tt.arrow)) throw err; - this.state = state; } - } else { - return this.parseNamedArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); } - } - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - this.toReferencedList(node.arguments); - } else if (this.hasPlugin("lightscript") && this.hasPlugin("flow") && this.isRelational("<")) { - // `fn() ->`, c/p of the above, but for `<` - const node = this.startNodeAt(startPos, startLoc), state = this.state.clone(); - node.callee = base; - try { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - this.expect(tt.parenL); - } catch (err) { - this.state = state; + if (refShorthandDefaultPos && refShorthandDefaultPos.start) { + this.unexpected(refShorthandDefaultPos.start); + } + this.toReferencedList(node.arguments); + } else if (this.hasPlugin("lightscript") && this.hasPlugin("flow") && this.isRelational("<")) { + // `fn() ->`, c/p of the above, but for `<` + const node = this.startNodeAt(startPos, startLoc), state = this.state.clone(); + node.callee = base; + try { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + this.expect(tt.parenL); + } catch (err) { + this.state = state; + return base; + } + node.arguments = this.parseCallExpressionArguments(tt.parenR, true, { start: 0 }); + if (!this.shouldParseArrow()) this.unexpected(); + return this.parseNamedArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); + } else if (this.match(tt.backQuote) && !(this.hasPlugin("lightscript") && this.isLineBreak())) { + const node = this.startNodeAt(startPos, startLoc); + node.tag = base; + node.quasi = this.parseTemplate(true); + base = this.finishNode(node, "TaggedTemplateExpression"); + } else { return base; } - node.arguments = this.parseCallExpressionArguments(tt.parenR, true, { start: 0 }); - if (!this.shouldParseArrow()) this.unexpected(); - return this.parseNamedArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); - } else if (this.match(tt.backQuote) && !(this.hasPlugin("lightscript") && this.isLineBreak())) { - const node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate(); - base = this.finishNode(node, "TaggedTemplateExpression"); - } else { - return base; } } -}; - -// last parameter (refShorthandDefaultPos) added for lightscript, -// but should be contributed upstream because it fixes a minor bug in babylon: -// `async({ foo = 1 })` parses as a function call but should raise an error. -pp.parseCallExpressionArguments = function (close, possibleAsyncArrow, refShorthandDefaultPos) { - const elts = []; - let innerParenStart; - let first = true; - - while (!this.eat(close)) { - if (first) { - first = false; - } else { - if (this.hasPlugin("lightscript")) { - this.expectCommaOrLineBreak(); + + // last parameter (refShorthandDefaultPos) added for lightscript, + // but should be contributed upstream because it fixes a minor bug in babylon: + // `async({ foo = 1 })` parses as a function call but should raise an error. + parseCallExpressionArguments(close, possibleAsyncArrow, refShorthandDefaultPos) { + const elts = []; + let innerParenStart; + let first = true; + + while (!this.eat(close)) { + if (first) { + first = false; } else { - this.expect(tt.comma); + if (this.hasPlugin("lightscript")) { + this.expectCommaOrLineBreak(); + } 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; } - if (this.eat(close)) break; + + elts.push(this.parseExprListItem(false, refShorthandDefaultPos, refShorthandDefaultPos)); } - // 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, refShorthandDefaultPos, refShorthandDefaultPos)); + return elts; } - // we found an async arrow function so let's not allow any inner parens - if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) { - this.unexpected(); + shouldParseAsyncArrow() { + if (this.hasPlugin("lightscript") && this.isLineBreak()) { + return false; + } + return this.match(tt.arrow); } - return elts; -}; - -pp.shouldParseAsyncArrow = function () { - if (this.hasPlugin("lightscript") && this.isLineBreak()) { - return false; + parseAsyncArrowFromCallExpression(node, call) { + this.check(tt.arrow); + return this.parseArrowExpression(node, call.arguments, true); } - return this.match(tt.arrow); -}; - -pp.parseAsyncArrowFromCallExpression = function (node, call) { - this.check(tt.arrow); - return this.parseArrowExpression(node, call.arguments, true); -}; - -// Parse a no-call expression (like argument of `new` or `::` operators). - -pp.parseNoCallExpr = function () { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); -}; - -// 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.parseExprAtom = function (refShorthandDefaultPos) { - const canBeArrow = this.state.potentialArrowAt === this.state.start; - let node; - - 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"); - } - - 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() outside of class constructor"); - } - return this.finishNode(node, "Super"); - case tt._import: - if (!this.hasPlugin("dynamicImport")) this.unexpected(); + // Parse a no-call expression (like argument of `new` or `::` operators). - node = this.startNode(); - this.next(); - if (!this.match(tt.parenL)) { - this.unexpected(null, tt.parenL); - } - return this.finishNode(node, "Import"); - - case tt._this: - node = this.startNode(); - this.next(); - return this.finishNode(node, "ThisExpression"); + parseNoCallExpr() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + } - case tt._yield: - if (this.state.inGenerator) this.unexpected(); + // 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 `{}`. - 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); + parseExprAtom(refShorthandDefaultPos) { + const canBeArrow = this.state.potentialArrowAt === this.state.start; + let node; - if (id.name === "await") { - if (this.state.inAsync || this.inModule) { - return this.parseAwait(node); + 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"); } - } else if (id.name === "async" && this.match(tt._function) && !this.canInsertSemicolon()) { + + 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.check(tt.arrow); - // let foo = bar => {}; - return this.parseArrowExpression(node, params, true); - } + 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"); - if (canBeArrow && !this.canInsertSemicolon() && this.match(tt.arrow)) { - return this.parseArrowExpression(node, [id]); - } + case tt._import: + if (!this.hasPlugin("dynamicImport")) this.unexpected(); - return id; + node = this.startNode(); + this.next(); + if (!this.match(tt.parenL)) { + this.unexpected(null, tt.parenL); + } + return this.finishNode(node, "Import"); - case tt._do: - if (this.hasPlugin("doExpressions")) { - const node = this.startNode(); + case tt._this: + 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"); - } + return this.finishNode(node, "ThisExpression"); - 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._yield: + if (this.state.inGenerator) this.unexpected(); - case tt.num: - return this.parseLiteral(this.state.value, "NumericLiteral"); + 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.string: - return this.parseLiteral(this.state.value, "StringLiteral"); + 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.check(tt.arrow); + // let foo = bar => {}; + return this.parseArrowExpression(node, params, true); + } - case tt._null: - node = this.startNode(); - this.next(); - return this.finishNode(node, "NullLiteral"); + if (canBeArrow && !this.canInsertSemicolon() && this.match(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._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.parenL: - return this.parseParenAndDistinguishExpression(null, null, canBeArrow); + 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.bracketL: - node = this.startNode(); - this.next(); - if (this.hasPlugin("lightscript") && this.match(tt._for)) { - return this.parseArrayComprehension(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(); + if (this.hasPlugin("lightscript") && this.match(tt._for)) { + return this.parseArrayComprehension(node); + } + node.elements = this.parseExprList(tt.bracketR, true, refShorthandDefaultPos); + this.toReferencedList(node.elements); + return this.finishNode(node, "ArrayExpression"); - case tt.backQuote: - return this.parseTemplate(); + 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(); - case tt._if: - if (this.hasPlugin("lightscript")) { - node = this.startNode(); - return this.parseIfExpression(node); - } + case tt.at: + this.parseDecorators(); - case tt.arrow: - if (this.hasPlugin("lightscript")) { + case tt._class: node = this.startNode(); - return this.parseArrowExpression(node, []); - } + this.takeDecorators(node); + return this.parseClass(node, false); - case tt.awaitArrow: - if (this.hasPlugin("lightscript")) { + case tt._new: + return this.parseNew(); + + case tt.backQuote: + return this.parseTemplate(false); + + case tt.doubleColon: node = this.startNode(); - const isSafe = this.state.value === " 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.toReferencedList(val.expressions); - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; + + parseParenExpression() { + this.expect(tt.parenL); + const val = this.parseExpression(); + this.expect(tt.parenR); + return val; } + 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; + } + } - this.addExtra(val, "parenthesized", true); - this.addExtra(val, "parenStart", startPos); + 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)); + } + } - return val; -}; + const innerEndPos = this.state.start; + const innerEndLoc = this.state.startLoc; + this.expect(tt.parenR); -pp.shouldParseArrow = function () { - return !this.canInsertSemicolon(); -}; + 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); + } -pp.parseArrow = function (node) { - if (this.match(tt.arrow)) { - return node; - } -}; + return this.parseArrowExpression(arrowNode, exprList); + } -pp.parseParenItem = function (node) { - return node; -}; + 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]; + } -// 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 -pp.parseNew = function () { - const node = this.startNode(); - const meta = this.parseIdentifier(true); + this.addExtra(val, "parenthesized", true); + this.addExtra(val, "parenStart", startPos); - if (this.eat(tt.dot)) { - return this.parseMetaProperty(node, meta, "target"); + return val; } - node.callee = this.parseNoCallExpr(); + shouldParseArrow() { + return !this.canInsertSemicolon(); + } - // Lightscript ASI: don't parse as arg list if on a different line - if (!(this.hasPlugin("lightscript") && this.isLineBreak()) && this.eat(tt.parenL)) { - node.arguments = this.parseExprList(tt.parenR); - this.toReferencedList(node.arguments); - } else { - node.arguments = []; + parseArrow(node) { + if (this.match(tt.arrow)) { + return node; + } } - return this.finishNode(node, "NewExpression"); -}; - -// Parse template expression. - -pp.parseTemplateElement = function () { - const elem = this.startNode(); - 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 () { - const node = this.startNode(); - this.next(); - node.expressions = []; - let curElt = this.parseTemplateElement(); - 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()); + parseParenItem(node) { + return node; } - this.next(); - return this.finishNode(node, "TemplateLiteral"); -}; - -// 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(); - - node.properties = []; - this.next(); - - // `for` keyword begins an object comprehension. - if (this.hasPlugin("lightscript") && this.match(tt._for)) { - // ...however, `{ for: x }` is a legal JS object. - if (this.lookahead().type !== tt.colon) { - return this.parseObjectComprehension(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 + + parseNew() { + const node = this.startNode(); + const meta = this.parseIdentifier(true); + + 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"); + } + + return metaProp; } - } - let firstRestLocation = null; + node.callee = this.parseNoCallExpr(); - while (!this.eat(tt.braceR)) { - if (first) { - first = false; + // Lightscript ASI: don't parse as arg list if on a different line + if (!(this.hasPlugin("lightscript") && this.isLineBreak()) && this.eat(tt.parenL)) { + node.arguments = this.parseExprList(tt.parenR); + this.toReferencedList(node.arguments); } else { - if (this.hasPlugin("lightscript")) { - this.expectCommaOrLineBreak(); + node.arguments = []; + } + + return this.finishNode(node, "NewExpression"); + } + + // Parse template expression. + + 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.expect(tt.comma); + this.state.invalidTemplateEscapePosition = null; } - if (this.eat(tt.braceR)) break; } + 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"); + } - while (this.match(tt.at)) { - decorators.push(this.parseDecorator()); + 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"); + } - let prop = this.startNode(), isGenerator = false, isAsync = false, startPos, startLoc; - if (decorators.length) { - prop.decorators = decorators; - decorators = []; + // Parse an object literal or binding pattern. + + parseObj(isPattern, refShorthandDefaultPos) { + let decorators = []; + const propHash = Object.create(null); + let first = true; + const node = this.startNode(); + + node.properties = []; + this.next(); + + // `for` keyword begins an object comprehension. + if (this.hasPlugin("lightscript") && this.match(tt._for)) { + // ...however, `{ for: x }` is a legal JS object. + if (this.lookahead().type !== tt.colon) { + return this.parseObjectComprehension(node); + } } - if (this.hasPlugin("objectRestSpread") && this.match(tt.ellipsis)) { - prop = this.parseSpread(isPattern ? { start: 0 } : undefined); - prop.type = isPattern ? "RestProperty" : "SpreadProperty"; - 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) { - // TODO: temporary rollback - // this.unexpected(position, "A trailing comma is not permitted after the rest element"); - continue; + let firstRestLocation = null; + + while (!this.eat(tt.braceR)) { + if (first) { + first = false; + } else { + if (this.hasPlugin("lightscript")) { + this.expectCommaOrLineBreak(); + } else { + this.expect(tt.comma); + } + if (this.eat(tt.braceR)) break; + } + + 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 = []; + } + + 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) || (this.hasPlugin("lightscript") && this.isLineBreak())) { - 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) || (this.hasPlugin("lightscript") && this.isLineBreak())) { + 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.hasPlugin("lightscript") && this.isLineBreak()) && + ( + 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.hasPlugin("lightscript") && this.isLineBreak()) && - ( - 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") { - if (isPattern) { + if (!prop.computed && prop.key.type === "Identifier") { 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) { - 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; + + return this.finishNode(prop, "ObjectProperty"); } - prop.shorthand = true; + } - return this.finishNode(prop, "ObjectProperty"); + 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; } -}; - -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; + + 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 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; - - if (this.hasPlugin("lightscript") && this.match(tt.colon)) { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - node.returnType = this.flowParseTypeAnnotation(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; + + // Initialize empty function node. + + initFunction(node, isAsync) { + node.id = null; + node.generator = false; + node.expression = false; + node.async = !!isAsync; } - if (this.hasPlugin("lightscript") && this.match(tt.arrow)) { - this.parseArrowType(node); + // 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; + + if (this.hasPlugin("lightscript") && this.match(tt.colon)) { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + node.returnType = this.flowParseTypeAnnotation(); + // TODO: support predicates (`%checks`) + if (node.returnType) node.predicate = null; + this.state.noAnonFunctionType = oldNoAnonFunctionType; + } + + if (this.hasPlugin("lightscript") && this.match(tt.arrow)) { + this.parseArrowType(node); + + if (node.kind === "get" || node.kind === "set") { + this.checkGetterSetterParamCount(node); + } - if (node.kind === "get" || node.kind === "set") { - this.checkGetterSetterParamCount(node); + this.parseArrowFunctionBody(node); + } else { + this.parseFunctionBody(node); } - this.parseArrowFunctionBody(node); - } else { - this.parseFunctionBody(node); + this.state.inMethod = oldInMethod; + return node; } - this.state.inMethod = oldInMethod; - return node; -}; + // Parse arrow function expression with given parameters. -// Parse arrow function expression with given parameters. + parseArrowExpression(node, params, isAsync) { + this.initFunction(node, isAsync); + node.params = this.toAssignableList(params, true, "arrow function parameters"); + if (this.hasPlugin("lightscript")) { + this.check(tt.arrow); + this.parseArrowType(node); + this.parseArrowFunctionBody(node); + } else { + this.expect(tt.arrow); + this.parseFunctionBody(node, true); + } + return this.finishNode(node, "ArrowFunctionExpression"); + } -pp.parseArrowExpression = function (node, params, isAsync) { - this.initFunction(node, isAsync); - node.params = this.toAssignableList(params, true, "arrow function parameters"); - if (this.hasPlugin("lightscript")) { - this.check(tt.arrow); - this.parseArrowType(node); - this.parseArrowFunctionBody(node); - } else { - this.expect(tt.arrow); - 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; + 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; + } } } - } - 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); - node.expression = false; - this.state.inFunction = oldInFunc; this.state.inGenerator = oldInGen; this.state.labels = oldLabels; + return false; } - this.state.inAsync = oldInAsync; - this.validateFunctionBody(node, allowExpression); -}; + // Parse function body and check parameters. + parseFunctionBody(node, allowExpression) { + const isExpression = allowExpression && !this.match(tt.braceL); -pp.validateFunctionBody = function (node, allowExpression) { - const isExpression = node.expression; - - // 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; + 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); + node.expression = false; + this.state.inFunction = oldInFunc; this.state.inGenerator = oldInGen; this.state.labels = oldLabels; + } + this.state.inAsync = oldInAsync; - if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") { - this.raise(node.id.start, "Binding yield in strict mode"); + this.validateFunctionBody(node, allowExpression); } - 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"); + validateFunctionBody(node, allowExpression) { + const isExpression = node.expression; + + // 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; + + if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") { + this.raise(node.id.start, "Binding yield in strict mode"); } - for (const param of (node.params: Array)) { - if (isStrict && param.type !== "Identifier") { - this.raise(param.start, "Non-simple parameter in strict mode"); + + 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"); } - this.checkLVal(param, true, nameHash, "function parameter list"); + 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; } - 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). + // 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). -pp.parseExprList = function (close, allowEmpty, refShorthandDefaultPos) { - const elts = []; - let first = true; + parseExprList(close, allowEmpty, refShorthandDefaultPos) { + const elts = []; + let first = true; - while (!this.eat(close)) { - if (first) { - first = false; - } else { - if (this.hasPlugin("lightscript")) { - this.expectCommaOrLineBreak(); + while (!this.eat(close)) { + if (first) { + first = false; } else { - this.expect(tt.comma); + if (this.hasPlugin("lightscript")) { + this.expectCommaOrLineBreak(); + } else { + this.expect(tt.comma); + } + if (this.eat(close)) break; } - if (this.eat(close)) break; - } - 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); + elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); + } + return elts; } - return elt; -}; - -// Parse the next token as an identifier. If `liberal` is true (used -// when parsing properties), it will also convert keywords into -// identifiers. -pp.parseIdentifier = function (liberal) { - const node = this.startNode(); - if (!liberal) { - this.checkReservedWord(this.state.value, this.state.start, !!this.state.type.keyword, false); + 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; } - 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(); - } + // Parse the next token as an identifier. If `liberal` is true (used + // when parsing properties), it will also convert keywords into + // identifiers. - if (!liberal && node.name === "await" && this.state.inAsync) { - this.raise(node.start, "invalid use of await inside of an async function"); - } + parseIdentifier(liberal) { + const node = this.startNode(); + if (!liberal) { + this.checkReservedWord(this.state.value, this.state.start, !!this.state.type.keyword, false); + } - node.loc.identifierName = node.name; + 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(); + } - this.next(); - return this.finishNode(node, "Identifier"); -}; + if (!liberal && node.name === "await" && this.state.inAsync) { + this.raise(node.start, "invalid use of await inside of an async function"); + } -pp.checkReservedWord = function (word, startLoc, checkKeywords, isBinding) { - if (this.isReservedWord(word) || (checkKeywords && this.isKeyword(word))) { - this.raise(startLoc, word + " is a reserved word"); - } + node.loc.identifierName = node.name; - if (this.state.strict && (reservedWords.strict(word) || (isBinding && reservedWords.strictBind(word)))) { - this.raise(startLoc, word + " is a reserved word in strict mode"); + 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 c3b6c742ac..7a66b89a54 100644 --- a/src/parser/index.js +++ b/src/parser/index.js @@ -1,31 +1,21 @@ -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 = {}; -const frozenDeprecatedWildcardPluginList = [ - "jsx", - "doExpressions", - "objectRestSpread", - "decorators", - "classProperties", - "exportExtensions", - "asyncGenerators", - "functionBind", - "functionSent", - "dynamicImport", - "flow" -]; +export const plugins: { [name: string]: (superClass: Class) => Class } = {}; -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); 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. @@ -34,81 +24,18 @@ 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 { - if (this.plugins["*"] && frozenDeprecatedWildcardPluginList.indexOf(name) > -1) { - return true; - } - - return !!this.plugins[name]; - } - - extend(name: string, f: Function) { - this[name] = f(this[name]); - } - - loadAllPlugins() { - // ensure flow plugin loads last, also ensure estree is not loaded with * - const pluginNames = Object.keys(plugins).filter((name) => name !== "flow" && name !== "estree"); - 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) { - // 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: { - type: "Program", - body: Array - } - } { + parse(): File { const file = this.startNode(); const program = this.startNode(); this.nextToken(); 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/parser/location.js b/src/parser/location.js index 2a408a5100..aed2760d62 100644 --- a/src/parser/location.js +++ b/src/parser/location.js @@ -1,7 +1,7 @@ -import { getLineInfo } from "../util/location"; -import Parser from "./index"; +// @flow -const pp = Parser.prototype; +import { getLineInfo } from "../util/location"; +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 +9,14 @@ 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: number, message: string): empty { + const loc = getLineInfo(this.input, pos); + message += ` (${loc.line}:${loc.column})`; + // $FlowIgnore + const err: SyntaxError & { pos: number, loc: Position } = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + throw err; + } +} diff --git a/src/parser/lval.js b/src/parser/lval.js index da712e3298..811c37038a 100644 --- a/src/parser/lval.js +++ b/src/parser/lval.js @@ -1,264 +1,283 @@ -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"); +// @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: Node, isBinding: ?boolean, contextDescription: string): Node { + 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) { + 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 "SpreadProperty": - node.type = "RestProperty"; - 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: Expression[], isBinding: ?boolean, contextDescription: string): $ReadOnlyArray { + 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) this.toAssignable(elt, isBinding, contextDescription); + + // Convert list of expression atoms to a list of + + toReferencedList(exprList: $ReadOnlyArray): $ReadOnlyArray { + 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.parseBindingIdentifier(); - 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: - if (this.state.strict || this.state.inGenerator) this.unexpected(); - // fall-through - case tt.name: - return this.parseIdentifier(true); - - 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: ?Pos): T { + const node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos); + return this.finishNode(node, "SpreadElement"); + } + + parseRest(): RestElement { + const node = this.startNode(); + this.next(); + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); + } + + shouldAllowYieldIdentifier(): boolean { + 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(): Identifier { + return this.parseIdentifier(this.shouldAllowYieldIdentifier()); + } + + // Parses lvalue (assignable) atom. + parseBindingAtom(): Pattern { + 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: + throw 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: TokenType, allowEmpty?: boolean): $ReadOnlyArray { + 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)) { + // $FlowFixMe This method returns `$ReadOnlyArray` if `allowEmpty` is set. + 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; } - 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; - } - } - break; - case "MemberExpression": - if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); - break; + parseAssignableListItemTypes(param: Pattern): Pattern { + return param; + } - 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; + // Parses assignment pattern around given atom if possible. - case "ArrayPattern": - for (const elem of (expr.elements: Array)) { - if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern"); - } - break; + parseMaybeDefault(startPos?: ?number, startLoc?: ?Position, left?: ?Pattern): Pattern { + 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: Expression, + isBinding: ?boolean, + checkClashes: ?{ [key: string]: boolean }, + contextDescription: string): void { + 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; - case "AssignmentPattern": - this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern"); - break; + case "MemberExpression": + if (isBinding) + this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); + break; - case "RestProperty": - this.checkLVal(expr.argument, isBinding, checkClashes, "rest property"); - break; + case "ObjectPattern": + for (let prop of expr.properties) { + if (prop.type === "ObjectProperty") prop = prop.value; + this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern"); + } + break; - case "RestElement": - this.checkLVal(expr.argument, isBinding, checkClashes, "rest element"); - break; + case "ArrayPattern": + for (const elem of expr.elements) { + if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern"); + } + 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); + case "AssignmentPattern": + this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern"); + 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); + } } } -}; +} diff --git a/src/parser/node.js b/src/parser/node.js index 86f697c130..cc8f514366 100644 --- a/src/parser/node.js +++ b/src/parser/node.js @@ -1,30 +1,41 @@ +// @flow + import Parser from "./index"; -import { SourceLocation } from "../util/location"; +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 pp = Parser.prototype; const commentKeys = ["leadingComments", "trailingComments", "innerComments"]; -class Node { - constructor(pos?: number, loc?: number, filename?: string) { +class Node implements NodeBase { + 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; - 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]; } } @@ -33,30 +44,40 @@ class Node { } } -pp.startNode = function () { - return new Node(this.state.start, this.state.startLoc, this.filename); -}; +export class NodeUtils extends UtilParser { + startNode(): T { + // $FlowIgnore + return new Node(this, this.state.start, this.state.startLoc); + } -pp.startNodeAt = function (pos, loc) { - return new Node(pos, loc, this.filename); -}; + startNodeAt(pos: number, loc: Position): T { + // $FlowIgnore + return new Node(this, pos, loc); + } -function finishNodeAt(node, type, pos, loc) { - node.type = type; - node.end = pos; - node.loc.end = loc; - this.processComment(node); - return node; -} + // Finish an AST node, adding `type` and `end` properties. -// Finish an AST node, adding `type` and `end` properties. + finishNode(node: T, type: string): T { + return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); + } -pp.finishNode = function (node, type) { - return finishNodeAt.call(this, node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); -}; + // Finish node at given position -// Finish node at given position + finishNodeAt(node: T, type: string, pos: number, loc: Position): T { + node.type = type; + node.end = pos; + node.loc.end = loc; + if (this.options.ranges) node.range[1] = pos; + this.processComment(node); + return node; + } -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 + */ + 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]; + } +} diff --git a/src/parser/statement.js b/src/parser/statement.js index d26ca4d1f8..9aee06b418 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -1,309 +1,347 @@ /* 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: - // in lightscript, allow line-starting `{` to be parsed as obj or obj pattern - if (this.hasPlugin("lightscript") && this.isLineBreak()) { - break; - } else { - 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); + 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: + // in lightscript, allow line-starting `{` to be parsed as obj or obj pattern + if (this.hasPlugin("lightscript") && this.isLineBreak()) { + break; } else { - this.state = state; + 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(); - - // rewrite `x = val` and `x: type = val` - if (this.hasPlugin("lightscript") && this.isColonConstAssign(expr)) { - const decl = this.rewriteAssignmentAsDeclarator(expr); - node.kind = "const"; - this.addExtra(node, "implicit", true); - node.declarations = [decl]; - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); - } + // 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(); + + // rewrite `x = val` and `x: type = val` + if (this.hasPlugin("lightscript") && this.isColonConstAssign(expr)) { + const decl = this.rewriteAssignmentAsDeclarator(expr); + node.kind = "const"; + this.addExtra(node, "implicit", true); + node.declarations = [decl]; + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); + } - // rewrite standalone NamedArrowExpression as NamedArrowDeclaration - if (this.hasPlugin("lightscript") && expr.type === "NamedArrowExpression") { - return this.finishNode(expr, "NamedArrowDeclaration"); - } + // rewrite standalone NamedArrowExpression as NamedArrowDeclaration + if (this.hasPlugin("lightscript") && expr.type === "NamedArrowExpression") { + return this.finishNode(expr, "NamedArrowDeclaration"); + } - if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) { - return this.parseLabeledStatement(node, maybeName, expr); - } else { - return this.parseExpressionStatement(node, expr); + if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) { + return this.parseLabeledStatement(node, maybeName, expr); + } else { + return this.parseExpressionStatement(node, expr); + } } -}; -pp.takeDecorators = function (node) { - if (this.state.decorators.length) { - node.decorators = this.state.decorators; - this.state.decorators = []; + takeDecorators(node) { + if (this.state.decorators.length) { + node.decorators = this.state.decorators; + this.state.decorators = []; + } } -}; -pp.parseDecorators = function (allowExport) { - while (this.match(tt.at)) { - const decorator = this.parseDecorator(); - this.state.decorators.push(decorator); - } + parseDecorators(allowExport) { + while (this.match(tt.at)) { + const decorator = this.parseDecorator(); + this.state.decorators.push(decorator); + } - if (allowExport && this.match(tt._export)) { - return; + if (allowExport && this.match(tt._export)) { + return; + } + + if (!this.match(tt._class)) { + this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); + } } - if (!this.match(tt._class)) { - this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); + parseDecorator() { + if (!this.hasPlugin("decorators")) { + this.unexpected(); + } + + const node = this.startNode(); + this.next(); + node.expression = this.parseMaybeAssign(); + return this.finishNode(node, "Decorator"); } -}; -pp.parseDecorator = function () { - if (!this.hasPlugin("decorators")) { - this.unexpected(); + 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(); + } + + // 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"); } - 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(); + + parseDebuggerStatement(node) { + this.next(); this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); } - // 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; + parseDoStatement(node) { + this.next(); + this.state.labels.push(loopLabel); + let isWhiteBlock, indentLevel; + if (this.hasPlugin("lightscript") && this.match(tt.colon)) { + isWhiteBlock = true; + indentLevel = this.state.indentLevel; } - } - 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); - let isWhiteBlock, indentLevel; - if (this.hasPlugin("lightscript") && this.match(tt.colon)) { - isWhiteBlock = true; - indentLevel = this.state.indentLevel; - } - node.body = this.parseStatement(false); - this.state.labels.pop(); - if (this.hasPlugin("lightscript") && isWhiteBlock && this.state.indentLevel !== indentLevel) { - this.unexpected(null, "Mismatched indent."); - } - this.expect(tt._while); - - // do-while can't use the lightscript-defined parseParenExpression - // b/c it expects a trailing colon or brace, which you don't have here. - - if (this.hasPlugin("lightscript")) { - // allow parens; enforce semicolon or newline whether they're used or not. - node.test = this.parseExpression(); - if (node.test.extra && node.test.extra.parenthesized) { - delete node.test.extra.parenthesized; - delete node.test.extra.parenStart; - this.addExtra(node, "hasParens", true); + node.body = this.parseStatement(false); + this.state.labels.pop(); + if (this.hasPlugin("lightscript") && isWhiteBlock && this.state.indentLevel !== indentLevel) { + this.unexpected(null, "Mismatched indent."); } - this.semicolon(); - } else { - node.test = this.parseParenExpression(); - this.eat(tt.semi); - } + this.expect(tt._while); + + // do-while can't use the lightscript-defined parseParenExpression + // b/c it expects a trailing colon or brace, which you don't have here. - return this.finishNode(node, "DoWhileStatement"); -}; + if (this.hasPlugin("lightscript")) { + // allow parens; enforce semicolon or newline whether they're used or not. + node.test = this.parseExpression(); + if (node.test.extra && node.test.extra.parenthesized) { + delete node.test.extra.parenthesized; + delete node.test.extra.parenStart; + this.addExtra(node, "hasParens", true); + } + this.semicolon(); + } else { + node.test = this.parseParenExpression(); + this.eat(tt.semi); + } -// 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. + return this.finishNode(node, "DoWhileStatement"); + } -pp.parseForStatement = function (node) { - this.next(); - this.state.labels.push(loopLabel); + // 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. - let forAwait = false; - if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) { - forAwait = true; + parseForStatement(node) { this.next(); - } + this.state.labels.push(loopLabel); - if (this.hasPlugin("lightscript")) { - if (this.eat(tt.parenL)) { - this.addExtra(node, "hasParens", true); + let forAwait = false; + if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) { + forAwait = true; + this.next(); } - } else { - this.expect(tt.parenL); - } - if (this.match(tt.semi)) { - if (forAwait) { - this.unexpected(); + if (this.hasPlugin("lightscript")) { + if (this.eat(tt.parenL)) { + this.addExtra(node, "hasParens", true); + } + } else { + this.expect(tt.parenL); } - 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.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); + } + if (this.hasPlugin("lightscript") && (!forAwait)) { + // idx, elem, key, or val begins a LS-enhanced loop. + if ( + (this.isContextual("idx") || this.isContextual("elem") || this.isContextual("key") || this.isContextual("val")) + ) { + return this.parseEnhancedForIn(node); + } + } + + const refShorthandDefaultPos = { start: 0 }; + const init = this.parseExpression(true, refShorthandDefaultPos); if (this.match(tt._in) || this.isContextual("of")) { - if (init.declarations.length === 1 && !init.declarations[0].init) { - return this.parseForIn(node, init, forAwait); + if (this.hasPlugin("lightscript") && (!init.isNowAssign)) { + if (this.match(tt._in)) { + this.raise(this.state.lastTokStart, "for-in requires a variable qualifier: `now` to reassign an existing variable, or `const`, `let`, `var` to declare a new one. Use `idx` or `elem` to iterate an array. Use `key` or `val` to iterate an object."); + } else { + this.raise(this.state.lastTokStart, "for-of requires a variable qualifier: `now` to reassign an existing variable, or `const`, `let`, `var` to declare a new one."); + } } + + 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(); @@ -311,895 +349,875 @@ pp.parseForStatement = function (node) { return this.parseFor(node, init); } - if (this.hasPlugin("lightscript") && (!forAwait)) { - // idx, elem, key, or val begins a LS-enhanced loop. - if ( - (this.isContextual("idx") || this.isContextual("elem") || this.isContextual("key") || this.isContextual("val")) - ) { - return this.parseEnhancedForIn(node); - } + parseFunctionStatement(node) { + this.next(); + return this.parseFunction(node, true); } - const refShorthandDefaultPos = { start: 0 }; - const init = this.parseExpression(true, refShorthandDefaultPos); - if (this.match(tt._in) || this.isContextual("of")) { - if (this.hasPlugin("lightscript") && (!init.isNowAssign)) { - if (this.match(tt._in)) { - this.raise(this.state.lastTokStart, "for-in requires a variable qualifier: `now` to reassign an existing variable, or `const`, `let`, `var` to declare a new one. Use `idx` or `elem` to iterate an array. Use `key` or `val` to iterate an object."); - } else { - this.raise(this.state.lastTokStart, "for-of requires a variable qualifier: `now` to reassign an existing variable, or `const`, `let`, `var` to declare a new one."); - } - } - - 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); - } + // overridden in LightScript - if (forAwait) { - this.unexpected(); + 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"); } - return this.parseFor(node, init); -}; + parseReturnStatement(node) { + if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) { + this.raise(this.state.start, "'return' outside of function"); + } -pp.parseFunctionStatement = function (node) { - this.next(); - return this.parseFunction(node, true); -}; + this.next(); -// overridden in LightScript + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. -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"); -}; + if (this.isLineTerminator()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } -pp.parseReturnStatement = function (node) { - if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) { - this.raise(this.state.start, "'return' outside of function"); + return this.finishNode(node, "ReturnStatement"); } - this.next(); - - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. + 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 { + 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 (this.isLineTerminator()) { - node.argument = null; - } else { + 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"); } - 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 = []; + parseTryStatement(node) { + this.next(); + + node.block = this.parseBlock(); + node.handler = null; + + if (this.match(tt._catch)) { + const clause = this.startNode(); this.next(); - if (isCase) { - cur.test = this.parseExpression(); + + if (this.hasPlugin("lightscript")) { + if (this.eat(tt.parenL)) { + this.addExtra(clause, "hasParens", true); + } } else { - if (sawDefault) this.raise(this.state.lastTokStart, "Multiple default clauses"); - sawDefault = true; - cur.test = null; + this.expect(tt.parenL); } - this.expect(tt.colon); - } else { - if (cur) { - cur.consequent.push(this.parseStatement(true)); + clause.param = this.parseBindingAtom(); + this.checkLVal(clause.param, true, Object.create(null), "catch clause"); + if (this.hasPlugin("lightscript")) { + this.expectParenFreeBlockStart(clause); } else { - this.unexpected(); + this.expect(tt.parenR); } - } - } - 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. + clause.body = this.parseBlock(); + node.handler = this.finishNode(clause, "CatchClause"); + } -const empty = []; + node.guardedHandlers = empty; + node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null; -pp.parseTryStatement = function (node) { - this.next(); + if (!node.handler && !node.finalizer) { + this.raise(node.start, "Missing catch or finally clause"); + } - node.block = this.parseBlock(); - node.handler = null; + return this.finishNode(node, "TryStatement"); + } - if (this.match(tt._catch)) { - const clause = this.startNode(); + parseVarStatement(node, kind) { this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); + } - if (this.hasPlugin("lightscript")) { - if (this.eat(tt.parenL)) { - this.addExtra(clause, "hasParens", true); - } - } else { - this.expect(tt.parenL); - } - clause.param = this.parseBindingAtom(); - this.checkLVal(clause.param, true, Object.create(null), "catch clause"); - if (this.hasPlugin("lightscript")) { - this.expectParenFreeBlockStart(clause); - } else { - this.expect(tt.parenR); - } - clause.body = this.parseBlock(); - node.handler = this.finishNode(clause, "CatchClause"); + 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"); } - node.guardedHandlers = empty; - node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null; + 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"); + } - if (!node.handler && !node.finalizer) { - this.raise(node.start, "Missing catch or finally clause"); + parseEmptyStatement(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); } - 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`); + 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 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"); } - 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; + parseExpressionStatement(node, expr) { + node.expression = expr; + if (this.hasPlugin("lightscript")) { + // for array comprehensions. + // TODO: cleanup / think of a better way of doing this. + this.match(tt.bracketR) || this.match(tt._else) || this.match(tt._elif) || this.semicolon(); } else { - break; + this.semicolon(); } + return this.finishNode(node, "ExpressionStatement"); } - 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; - if (this.hasPlugin("lightscript")) { - // for array comprehensions. - // TODO: cleanup / think of a better way of doing this. - this.match(tt.bracketR) || this.match(tt._else) || this.match(tt._elif) || this.semicolon(); - } else { - this.semicolon(); + // 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"); } - 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; - - let isEnd; - if (this.hasPlugin("lightscript") && typeof end === "number") { - isEnd = () => this.state.indentLevel <= end || this.match(tt.eof); - } else { - isEnd = () => this.eat(end); + + isValidDirective(stmt) { + return stmt.type === "ExpressionStatement" && + stmt.expression.type === "StringLiteral" && + !stmt.expression.extra.parenthesized; } - while (!isEnd()) { - if (!parsedNonDirective && this.state.containsOctal && !octalPosition) { - octalPosition = this.state.octalPosition; + parseBlockBody(node, allowDirectives, topLevel, end) { + node.body = []; + node.directives = []; + + let parsedNonDirective = false; + let oldStrict; + let octalPosition; + + let isEnd; + if (this.hasPlugin("lightscript") && typeof end === "number") { + isEnd = () => this.state.indentLevel <= end || this.match(tt.eof); + } else { + isEnd = () => this.eat(end); } - const stmt = this.parseStatement(true, topLevel); + while (!isEnd()) { + 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); + } } - 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(); - - if (this.hasPlugin("lightscript")) { - this.expectParenFreeBlockStart(node); - } else { - this.expect(tt.parenR); - } + // Parse a regular `for` loop. The disambiguation code in + // `parseStatement` will already have parsed the init statement or + // expression. - 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) { - let type; - if (forAwait) { - this.eatContextual("of"); - type = "ForAwaitStatement"; - } else { - type = this.match(tt._in) ? "ForInStatement" : "ForOfStatement"; - this.next(); - } - node.left = init; - node.right = this.parseExpression(); + 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(); - if (this.hasPlugin("lightscript")) { - this.expectParenFreeBlockStart(node); - } else { - 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 (this.hasPlugin("lightscript") && !isFor && this.match(tt.awaitArrow)) { - decl.init = this.parseAwaitArrow(decl.id); - } 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"); + if (this.hasPlugin("lightscript")) { + this.expectParenFreeBlockStart(node); } else { - decl.init = null; + this.expect(tt.parenR); } - 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 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; + 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(); + + if (this.hasPlugin("lightscript")) { + this.expectParenFreeBlockStart(node); + } else { + 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 (this.hasPlugin("lightscript") && !isFor && this.match(tt.awaitArrow)) { + decl.init = this.parseAwaitArrow(decl.id); + } 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.isLineTerminator(); -}; + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody); -pp.isClassMutatorStarter = function () { - return false; -}; + this.state.inMethod = oldInMethod; -pp.parseClassBody = function (node) { - // class bodies are implicitly strict - const oldStrict = this.state.strict; - this.state.strict = true; + return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); + } - let hadConstructorCall = false; - let hadConstructor = false; - let decorators = []; - const classBody = this.startNode(); + parseFunctionParams(node) { + this.expect(tt.parenL); + node.params = this.parseBindingList(tt.parenR); + } - classBody.body = []; + // Parse a class declaration or literal (depending on the + // `isStatement` parameter). - let isEnd; - if (this.hasPlugin("lightscript") && this.match(tt.colon)) { - const indentLevel = this.state.indentLevel; + parseClass(node, isStatement, optionalId) { this.next(); - isEnd = () => this.state.indentLevel <= indentLevel || this.match(tt.eof); - } else { - this.expect(tt.braceL); - isEnd = () => this.eat(tt.braceR); + this.takeDecorators(node); + this.parseClassId(node, isStatement, optionalId); + this.parseClassSuper(node); + this.parseClassBody(node); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); } - while (!isEnd()) { - if (this.eat(tt.semi)) { - if (decorators.length > 0) { - this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon"); - } - continue; - } + isClassProperty() { + return this.match(tt.eq) || this.match(tt.semi) || this.match(tt.braceR); + } - if (this.match(tt.at)) { - decorators.push(this.parseDecorator()); - continue; - } + isClassMethod() { + return this.match(tt.parenL); + } - const method = this.startNode(); + isNonstaticConstructor(method) { + return !method.computed && !method.static && ( + (method.key.name === "constructor") || // Identifier + (method.key.value === "constructor") // Literal + ); + } - // steal the decorators if there are any - if (decorators.length) { - method.decorators = decorators; - decorators = []; - } + parseClassBody(node) { + // class bodies are implicitly strict + const oldStrict = this.state.strict; + this.state.strict = true; - 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; + let hadConstructor = false; + let decorators = []; + const classBody = this.startNode(); - this.parsePropertyName(method); + classBody.body = []; - method.static = isMaybeStatic && !this.match(tt.parenL); - if (method.static) { - isGenerator = this.eat(tt.star); - this.parsePropertyName(method); + let isEnd; + if (this.hasPlugin("lightscript") && this.match(tt.colon)) { + const indentLevel = this.state.indentLevel; + this.next(); + isEnd = () => this.state.indentLevel <= indentLevel || this.match(tt.eof); + } else { + this.expect(tt.braceL); + isEnd = () => this.eat(tt.braceR); } - if (!isGenerator) { - if (this.isClassProperty()) { - classBody.body.push(this.parseClassProperty(method)); + while (!isEnd()) { + if (this.eat(tt.semi)) { + if (decorators.length > 0) { + this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon"); + } 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); + if (this.match(tt.at)) { + decorators.push(this.parseDecorator()); + continue; } - } - 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; - this.parsePropertyName(method); - } - - method.kind = "method"; - - if (!method.computed) { - let { key } = method; + const method = this.startNode(); - // 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); + // steal the decorators if there are any + if (decorators.length) { + method.decorators = decorators; + decorators = []; } - // 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; + 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; + } + // otherwise something static + method.static = true; } - // 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"); + 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"); + } + 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.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; + if (decorators.length) { + this.raise(this.state.start, "You have trailing decorators with no method"); + } + + node.body = this.finishNode(classBody, "ClassBody"); + + 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); } - // 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"); + 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"); + } - this.parseClassMethod(classBody, method, isGenerator, isAsync); + parseClassMethod(classBody, method, isGenerator, isAsync) { + this.parseMethod(method, isGenerator, isAsync); + classBody.body.push(this.finishNode(method, "ClassMethod")); + } - if (isGetSet) { - this.checkGetterSetterParamCount(method); + parseClassId(node, isStatement, optionalId) { + if (this.match(tt.name)) { + node.id = this.parseIdentifier(); + } else { + if (optionalId || !isStatement) { + node.id = null; + } else { + this.unexpected(); + } } } - if (decorators.length) { - this.raise(this.state.start, "You have trailing decorators with no method"); + parseClassSuper(node) { + node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null; } - node.body = this.finishNode(classBody, "ClassBody"); + // Parses module export declaration. - this.state.strict = oldStrict; -}; + parseExport(node) { + this.eat(tt._export); -pp.parseClassProperty = function (node) { - if (this.match(tt.eq)) { - if (!this.hasPlugin("classProperties")) this.unexpected(); - this.next(); - node.value = this.parseMaybeAssign(); - } else { - node.value = null; - } - 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; - } else { - this.unexpected(); + // 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, "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(); + } + 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.parseClassSuper = function (node) { - node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null; -}; + parseExportDeclaration() { + return this.parseStatement(true); + } -// Parses module export declaration. + isExportDefaultSpecifier() { + if (this.match(tt.name)) { + return this.state.value !== "type" + && this.state.value !== "async" + && this.state.value !== "interface"; + } -pp.parseExport = function (node) { - this.next(); - // export * from '...' - if (this.match(tt.star)) { - const specifier = this.startNode(); - this.next(); - if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) { - specifier.exported = this.parseIdentifier(); - node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")]; - this.parseExportSpecifiersMaybe(node); - this.parseExportFrom(node, true); - } else { - this.parseExportFrom(node, true); - return this.finishNode(node, "ExportAllDeclaration"); + if (!this.match(tt._default)) { + return false; } - } 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); + + const lookahead = this.lookahead(); + return lookahead.type === tt.comma || (lookahead.type === tt.name && lookahead.value === "from"); + } + + parseExportSpecifiersMaybe(node) { + if (this.eat(tt.comma)) { + node.specifiers = node.specifiers.concat(this.parseExportSpecifiers()); } - 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.match(tt._class)) { - expr = this.parseClass(expr, true, true); + } + + parseExportFrom(node, expect?) { + if (this.eatContextual("from")) { + node.source = this.match(tt.string) ? this.parseExprAtom() : this.unexpected(); + this.checkExport(node); } else { - needsSemi = true; - expr = this.parseMaybeAssign(); + if (expect) { + this.unexpected(); + } else { + node.source = null; + } } - 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.semicolon(); } - if (!this.match(tt._default)) { - return false; + 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"); } - const lookahead = this.lookahead(); - return lookahead.type === tt.comma || (lookahead.type === tt.name && lookahead.value === "from"); -}; + 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); + } + } + } + } -pp.parseExportSpecifiersMaybe = function (node) { - if (this.eat(tt.comma)) { - node.specifiers = node.specifiers.concat(this.parseExportSpecifiers()); - } -}; - -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; + 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.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); + checkDeclaration(node) { + if (node.type === "ObjectPattern") { + for (const prop of node.properties) { + this.checkDeclaration(prop); } - } 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); + } 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); } } - 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"); + checkDuplicateExports(node, name) { + if (this.state.exportedIdentifiers.indexOf(name) > -1) { + this.raiseDuplicateExportError(node, name); } - this.takeDecorators(node.declaration); + this.state.exportedIdentifiers.push(name); } -}; -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); - } - } - } else if (node.type === "ObjectProperty") { - this.checkDeclaration(node.value); - } else if (node.type === "RestElement" || node.type === "RestProperty") { - this.checkDeclaration(node.argument); - } else if (node.type === "Identifier") { - this.checkDuplicateExports(node, 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.` + ); } -}; -pp.checkDuplicateExports = function(node, name) { - if (this.state.exportedIdentifiers.indexOf(name) > -1) { - this.raiseDuplicateExportError(node, name); - } - this.state.exportedIdentifiers.push(name); -}; + // Parses a comma-separated list of module exports. -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.` - ); -}; + parseExportSpecifiers() { + const nodes = []; + let first = true; + let needsFrom; -// Parses a comma-separated list of module exports. + // export { x, y as z } [from '...'] + this.expect(tt.braceL); -pp.parseExportSpecifiers = function () { - const nodes = []; - let first = true; - let needsFrom; + while (!this.eat(tt.braceR)) { + if (first) { + first = false; + } else { + this.expect(tt.comma); + if (this.eat(tt.braceR)) break; + } - // export { x, y as z } [from '...'] - this.expect(tt.braceL); + const isDefault = this.match(tt._default); + if (isDefault && !needsFrom) needsFrom = true; - while (!this.eat(tt.braceR)) { - if (first) { - first = false; - } else { - this.expect(tt.comma); - if (this.eat(tt.braceR)) break; + 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); -// Parses import declaration. + // 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"); + } -pp.parseImport = function (node) { - this.eat(tt._import); + // Parses a comma-separated list of module imports. - // 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; - } + 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; + } - 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 ea34bec217..58b9f4c31d 100644 --- a/src/parser/util.js +++ b/src/parser/util.js @@ -1,105 +1,96 @@ -import { types as tt } from "../tokenizer/types"; -import Parser from "./index"; -import { lineBreak } from "../util/whitespace"; +// @flow -const pp = Parser.prototype; +import { types as tt, type TokenType } from "../tokenizer/types"; +import Tokenizer from "../tokenizer"; +import type { Node } from "../types"; // ## Parser utilities -// TODO +export default class UtilParser extends Tokenizer { + // TODO -pp.addExtra = function (node, key, val) { - if (!node) return; + addExtra(node: Node, key: string, val: any): void { + if (!node) return; - const extra = node.extra = node.extra || {}; - extra[key] = val; -}; - -// TODO - -pp.isRelational = function (op) { - return this.match(tt.relational) && this.state.value === op; -}; + const extra = node.extra = node.extra || {}; + extra[key] = val; + } -// TODO + // TODO -pp.expectRelational = function (op) { - if (this.isRelational(op)) { - this.next(); - } else { - this.unexpected(null, tt.relational); + isRelational(op: "<" | ">"): boolean { + return this.match(tt.relational) && this.state.value === op; } -}; -// Tests whether parsed token is a contextual keyword. + // TODO -pp.isContextual = function (name) { - return this.match(tt.name) && this.state.value === name; -}; + expectRelational(op: "<" | ">"): void { + if (this.isRelational(op)) { + this.next(); + } else { + this.unexpected(null, tt.relational); + } + } -// Consumes contextual keyword if possible. + // Tests whether parsed token is a contextual keyword. -pp.eatContextual = function (name) { - return this.state.value === name && this.eat(tt.name); -}; + isContextual(name: string): boolean { + return this.match(tt.name) && this.state.value === name; + } -// Asserts that following token is given contextual keyword. + // Consumes contextual keyword if possible. -pp.expectContextual = function (name, message) { - if (!this.eatContextual(name)) this.unexpected(null, message); -}; + eatContextual(name: string): boolean { + return this.state.value === name && this.eat(tt.name); + } -// added for lightscript + // Asserts that following token is given contextual keyword. -pp.isLineBreak = function () { - if (this.hasPlugin("lightscript")) { - // treat start-of-file as newline. - // TODO: reconsider/reevaluate - if (!this.state.lastTokEnd) return true; + expectContextual(name: string, message?: string): void { + if (!this.eatContextual(name)) this.unexpected(null, message); } - return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); -}; -// 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) || - this.isLineBreak(); -}; + canInsertSemicolon(): boolean { + return this.match(tt.eof) || + this.match(tt.braceR) || + this.isLineBreak(); + } -// TODO + // TODO -pp.isLineTerminator = function () { - return this.eat(tt.semi) || this.canInsertSemicolon(); -}; + 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. + // 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(): 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 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: TokenType, pos?: ?number): void { + this.eat(type) || this.unexpected(pos, type); + } -// Expect, but without eating + // Expect, but without eating -pp.check = function (type, pos) { - return this.match(type) || this.unexpected(pos, type); -}; + check(type: TokenType, pos?: ?number): boolean { + return this.match(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: ?number, messageOrType: string | TokenType = "Unexpected token"): empty { + if (typeof messageOrType !== "string") { + messageOrType = `Unexpected token, expected ${messageOrType.label}`; + } + throw this.raise(pos != null ? pos : this.state.start, messageOrType); } - this.raise(pos != null ? pos : this.state.start, messageOrType); -}; +} diff --git a/src/plugins/estree.js b/src/plugins/estree.js index 55977c1a70..51c1e5d96a 100644 --- a/src/plugins/estree.js +++ b/src/plugins/estree.js @@ -1,252 +1,232 @@ +// @flow + import { types as tt } from "../tokenizer/types"; -import Parser from "../parser"; +import type Parser from "../parser"; +import * as N from "../types"; -const pp = Parser.prototype; +function isSimpleProperty(node: N.Node): boolean { + return node != null && + 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. +export default (superClass: Class): Class => class extends superClass { + estreeParseRegExpLiteral({ pattern, flags }: N.RegExpLiteral): N.Node { + 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; } - const node = this.estreeParseLiteral(regex); - node.regex = { pattern, flags }; - return node; -}; + estreeParseLiteral(value: any): N.Node { + return this.parseLiteral(value, "Literal"); + } -pp.estreeParseLiteral = function (value) { - return this.parseLiteral(value, "Literal"); -}; + directiveToStmt(directive: N.Directive): N.ExpressionStatement { + const directiveLiteral = directive.value; -pp.directiveToStmt = function (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); -}; + // ================================== + // Overrides + // ================================== + + checkDeclaration(node: N.Pattern): void { + if (isSimpleProperty(node)) { + // $FlowFixMe + this.checkDeclaration(node.value); + } else { + super.checkDeclaration(node); + } + } -function isSimpleProperty(node) { - return node && - node.type === "Property" && - node.kind === "init" && - node.method === false; -} + checkGetterSetterParamCount(prop: N.ObjectMethod): void { + if (this.hasPlugin("lightscript") && prop.params) { + return super.checkGetterSetterParamCount(prop); + } -export default function (instance) { - instance.extend("checkDeclaration", function(inner) { - return function (node) { - if (isSimpleProperty(node)) { - this.checkDeclaration(node.value); + 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(inner) { - return function (prop) { - if (this.hasPlugin("lightscript") && prop.params) { - return inner.apply(this, arguments); - } + checkLVal( + expr: N.Expression, isBinding: ?boolean, checkClashes: ?{ [key: string]: boolean }, ...args): void { + 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: N.ObjectMember, propHash: { [key: string]: boolean }): void { + if (prop.computed || !isSimpleProperty(prop)) return; - 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"); + 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: { body: N.BlockStatement }, isExpression?: boolean): boolean { + if (!isExpression && node.body.body.length > 0) { + for (const directive of node.body.body) { + 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: N.Statement): boolean { + 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: N.BlockStatementLike, ...args): void { + 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); - } - }; - }); + const directiveStatements = node.directives.map((d) => this.directiveToStmt(d)); + node.body = directiveStatements.concat(node.body); + 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): N.Expression { + 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): T { + const node = super.parseLiteral(...args); + node.raw = node.extra.raw; + delete node.extra; + + return node; + } + + 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): ?N.ObjectMethod { + const node = super.parseObjectMethod(...args); + + if (node) { + if (node.kind === "method") node.kind = "init"; + node.type = "Property"; + } + + return node; + } + + parseObjectProperty(...args): ?N.ObjectProperty { + const node = super.parseObjectProperty(...args); + + if (node) { + node.kind = "init"; + node.type = "Property"; + } + + return node; + } + + toAssignable(node: N.Node, isBinding: ?boolean, ...args): N.Node { + 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) { + 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 459f6e2c37..6c0840d126 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -1,8 +1,11 @@ /* eslint max-len: 0 */ -import { types as tt } from "../tokenizer/types"; -import { types as ct } from "../tokenizer/context"; -import Parser from "../parser"; +// @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", @@ -16,1342 +19,1426 @@ 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: N.Node): boolean { + 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.expression = this.parseExpression(); - this.expect(tt.parenR); - return this.finishNode(node, "DeclaredPredicate"); - } else { - return this.finishNode(node, "InferredPredicate"); - } -}; +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); -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() : N.FlowType { + 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(): [?N.FlowType, ?N.FlowPredicate] { + 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, true); - return this.finishNode(node, "DeclareClass"); -}; + flowParseDeclareClass(node: N.FlowDeclareClass): N.FlowDeclareClass { + this.next(); + this.flowParseInterfaceish(node); + return this.finishNode(node, "DeclareClass"); + } -pp.flowParseDeclareFunction = function (node) { - this.next(); + flowParseDeclareFunction(node: N.FlowDeclareFunction): N.FlowDeclareFunction { + this.next(); - const id = node.id = this.parseIdentifier(); + const id = node.id = this.parseIdentifier(); - const typeNode = this.startNode(); - const typeContainer = this.startNode(); + const typeNode = this.startNode(); + const typeContainer = this.startNode(); - if (this.isRelational("<")) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; - } + if (this.isRelational("<")) { + typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + typeNode.typeParameters = null; + } + + this.expect(tt.parenL); + const tmp = this.flowParseFunctionTypeParams(); + typeNode.params = tmp.params; + typeNode.rest = tmp.rest; + this.expect(tt.parenR); - this.expect(tt.parenL); - const tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - this.expect(tt.parenR); - let predicate = null; - [typeNode.returnType, predicate] = this.flowParseTypeAndPredicateInitialiser(); - typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); - typeContainer.predicate = predicate; - id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); + // $FlowFixMe (destructuring not supported yet) + [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); - this.finishNode(id, id.type); + id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); - this.semicolon(); + this.finishNode(id, id.type); - return this.finishNode(node, "DeclareFunction"); -}; + this.semicolon(); -pp.flowParseDeclare = function (node) { - 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); + return this.finishNode(node, "DeclareFunction"); + } + + flowParseDeclare(node: N.FlowDeclare, insideModule?: boolean): N.FlowDeclare { + 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 { - return this.flowParseDeclareModule(node); + throw this.unexpected(); } - } else if (this.isContextual("type")) { - return this.flowParseDeclareTypeAlias(node); - } else if (this.isContextual("interface")) { - return this.flowParseDeclareInterface(node); - } else { - this.unexpected(); } -}; -pp.flowParseDeclareVariable = function (node) { - this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier(); - this.semicolon(); - return this.finishNode(node, "DeclareVariable"); -}; + flowParseDeclareVariable(node: N.FlowDeclareVariable): N.FlowDeclareVariable { + this.next(); + node.id = this.flowParseTypeAnnotatableIdentifier(); + this.semicolon(); + return this.finishNode(node, "DeclareVariable"); + } -pp.flowParseDeclareModule = function (node) { - this.next(); + flowParseDeclareModule(node: N.FlowDeclareModule): N.FlowDeclareModule { + this.next(); - if (this.match(tt.string)) { - node.id = this.parseExprAtom(); - } else { - node.id = this.parseIdentifier(); - } + if (this.match(tt.string)) { + node.id = this.parseExprAtom(); + } else { + node.id = this.parseIdentifier(); + } - const bodyNode = node.body = this.startNode(); - const body = bodyNode.body = []; - this.expect(tt.braceL); - while (!this.match(tt.braceR)) { - let bodyNode = this.startNode(); + 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`"); - } + 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`"); + } - this.parseImport(bodyNode); - } else { - this.expectContextual("declare", "Only declares and type imports are allowed inside declare module"); + this.parseImport(bodyNode); + } else { + this.expectContextual("declare", "Only declares and type imports are allowed inside declare module"); + + bodyNode = this.flowParseDeclare(bodyNode, true); + } - bodyNode = this.flowParseDeclare(bodyNode, true); + body.push(bodyNode); } + 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; + } + }); - body.push(bodyNode); + node.kind = kind || "CommonJS"; + return this.finishNode(node, "DeclareModule"); } - this.expect(tt.braceR); - - this.finishNode(bodyNode, "BlockStatement"); - return this.finishNode(node, "DeclareModule"); -}; -pp.flowParseDeclareModuleExports = function (node) { - this.expectContextual("module"); - this.expect(tt.dot); - this.expectContextual("exports"); - node.typeAnnotation = this.flowParseTypeAnnotation(); - this.semicolon(); + flowParseDeclareExportDeclaration(node: N.FlowDeclareExportDeclaration, insideModule: ?boolean): N.FlowDeclareExportDeclaration { + this.expect(tt._export); - return this.finishNode(node, "DeclareModuleExports"); -}; + 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; -pp.flowParseDeclareTypeAlias = function (node) { - this.next(); - this.flowParseTypeAlias(node); - return this.finishNode(node, "DeclareTypeAlias"); -}; + 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.flowParseDeclareInterface = function (node) { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareInterface"); -}; + 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 + // $FlowIgnore + node.type = "ExportDeclaration"; + // $FlowFixMe + node.default = false; + delete node.exportKind; + } -// Interfaces + // $FlowIgnore + node.type = "Declare" + node.type; -pp.flowParseInterfaceish = function (node, allowStatic) { - node.id = this.parseIdentifier(); + return node; + } + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; + throw this.unexpected(); } - node.extends = []; - node.mixins = []; + flowParseDeclareModuleExports(node: N.FlowDeclareModuleExports): N.FlowDeclareModuleExports { + 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: N.FlowDeclareTypeAlias): N.FlowDeclareTypeAlias { 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(allowStatic); -}; + flowParseDeclareInterface(node: N.FlowDeclareInterface): N.FlowDeclareInterface { + 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: N.FlowDeclare): void { + 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, false); - 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(): N.FlowInterfaceExtends { + 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: N.FlowInterface): N.FlowInterface { + this.flowParseInterfaceish(node); + return this.finishNode(node, "InterfaceDeclaration"); } - node.right = this.flowParseTypeInitialiser(tt.eq); - this.semicolon(); + flowParseRestrictedIdentifier(liberal?: boolean): N.Identifier { + 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: N.FlowTypeAlias): N.FlowTypeAlias { + 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(): N.FlowTypeParameter { + 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(): N.FlowTypeParameterDeclaration { + 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(); } + + do { + node.params.push(this.flowParseTypeParameter()); + if (!this.isRelational(">")) { + this.expect(tt.comma); + } + } while (!this.isRelational(">")); + this.expectRelational(">"); + + this.state.inType = oldInType; + + return this.finishNode(node, "TypeParameterDeclaration"); } - this.expectRelational(">"); - this.state.inType = oldInType; + flowParseTypeParameterInstantiation(): N.FlowTypeParameterInstantiation { + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; - return this.finishNode(node, "TypeParameterInstantiation"); -}; + this.state.inType = true; -pp.flowParseObjectPropertyKey = function () { - return (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); -}; + this.expectRelational("<"); + while (!this.isRelational(">")) { + node.params.push(this.flowParseType()); + if (!this.isRelational(">")) { + this.expect(tt.comma); + } + } + this.expectRelational(">"); -pp.flowParseObjectTypeIndexer = function (node, isStatic, variance) { - node.static = isStatic; + this.state.inType = oldInType; - 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(); + return this.finishNode(node, "TypeParameterInstantiation"); } - this.expect(tt.bracketR); - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - this.flowObjectTypeSemicolon(); - return this.finishNode(node, "ObjectTypeIndexer"); -}; + flowParseObjectPropertyKey(): N.Expression { + return (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true); + } + + flowParseObjectTypeIndexer(node: N.FlowObjectTypeIndexer, isStatic: boolean, variance: ?N.FlowVariance): N.FlowObjectTypeIndexer { + node.static = isStatic; -pp.flowParseObjectTypeMethodish = function (node) { - node.params = []; - node.rest = null; - node.typeParameters = null; + 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.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); + return this.finishNode(node, "ObjectTypeIndexer"); } - this.expect(tt.parenL); - while (this.match(tt.name)) { - node.params.push(this.flowParseFunctionTypeParam()); - if (!this.match(tt.parenR)) { - this.expect(tt.comma); + flowParseObjectTypeMethodish(node: N.FlowFunctionTypeAnnotation): N.FlowFunctionTypeAnnotation { + node.params = []; + node.rest = null; + node.typeParameters = null; + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + + this.expect(tt.parenL); + while (this.match(tt.name)) { + node.params.push(this.flowParseFunctionTypeParam()); + if (!this.match(tt.parenR)) { + this.expect(tt.comma); + } + } + + if (this.eat(tt.ellipsis)) { + node.rest = this.flowParseFunctionTypeParam(); } + this.expect(tt.parenR); + node.returnType = this.flowParseTypeInitialiser(); + + return this.finishNode(node, "FunctionTypeAnnotation"); } - if (this.eat(tt.ellipsis)) { - node.rest = this.flowParseFunctionTypeParam(); + 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"); } - this.expect(tt.parenR); - node.returnType = this.flowParseTypeInitialiser(); - return this.finishNode(node, "FunctionTypeAnnotation"); -}; + flowParseObjectType(allowStatic: boolean, allowExact: boolean, allowSpread: boolean): N.FlowObjectTypeAnnotation { + const oldInType = this.state.inType; + this.state.inType = true; -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; - this.flowObjectTypeSemicolon(); - return this.finishNode(node, "ObjectTypeProperty"); -}; + const nodeStart = this.startNode(); -pp.flowParseObjectTypeCallProperty = function (node, isStatic) { - const valueNode = this.startNode(); - node.static = isStatic; - node.value = this.flowParseObjectTypeMethodish(valueNode); - this.flowObjectTypeSemicolon(); - return this.finishNode(node, "ObjectTypeCallProperty"); -}; + nodeStart.callProperties = []; + nodeStart.properties = []; + nodeStart.indexers = []; -pp.flowParseObjectType = function (allowStatic, allowExact) { - const oldInType = this.state.inType; - this.state.inType = true; - - const nodeStart = this.startNode(); - let node; - let propertyKey; - let isStatic = false; - - nodeStart.callProperties = []; - nodeStart.properties = []; - nodeStart.indexers = []; - - 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; - } + 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; + } - nodeStart.exact = exact; + nodeStart.exact = exact; - while (!this.match(endDelim)) { - let optional = false; - const startPos = this.state.start; - const startLoc = this.state.startLoc; - node = this.startNode(); - if (allowStatic && this.isContextual("static") && this.lookahead().type !== tt.colon) { - this.next(); - isStatic = 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 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(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(); + } + } + + nodeStart.properties.push(this.flowParseObjectTypeProperty(node, isStatic, variance, kind, allowSpread)); + } + + this.flowObjectTypeSemicolon(); } - const variancePos = this.state.start; - const variance = this.flowParseVariance(); + this.expect(endDelim); + + const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); + + this.state.inType = oldInType; - if (this.match(tt.bracketL)) { - nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); - } else if (this.match(tt.parenL) || this.isRelational("<")) { + return out; + } + + 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( + null, + "Spread operator cannot appear in class or interface definitions" + ); + } if (variance) { - this.unexpected(variancePos); + this.unexpected(variance.start, "Spread properties cannot have variance"); } - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + this.expect(tt.ellipsis); + node.argument = this.flowParseType(); + + return this.finishNode(node, "ObjectTypeSpreadProperty"); } else { - propertyKey = this.flowParseObjectPropertyKey(); + 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(variancePos); + this.unexpected(variance.start); } - nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey)); + + 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.key = propertyKey; node.value = this.flowParseTypeInitialiser(); - node.optional = optional; - node.static = isStatic; node.variance = variance; - this.flowObjectTypeSemicolon(); - nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty")); + } - } - isStatic = false; + node.optional = optional; + + return this.finishNode(node, "ObjectTypeProperty"); + } } - this.expect(endDelim); + // This is similar to checkGetterSetterParamCount, but as + // babylon uses non estree properties we cannot reuse it here + flowCheckGetterSetterParamCount(property: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty): void { + 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"); + } + } + } - const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); + flowObjectTypeSemicolon(): void { + if (!this.eat(tt.semi) && !this.eat(tt.comma) && + !this.match(tt.braceR) && !this.match(tt.braceBarR)) { + this.unexpected(); + } + } - this.state.inType = oldInType; + 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(); - return out; -}; + while (this.eat(tt.dot)) { + const node2 = this.startNodeAt(startPos, startLoc); + node2.qualification = node; + node2.id = this.parseIdentifier(); + node = this.finishNode(node2, "QualifiedTypeIdentifier"); + } -pp.flowObjectTypeSemicolon = function () { - if (!this.eat(tt.semi) && !this.eat(tt.comma) && - !this.match(tt.braceR) && !this.match(tt.braceBarR)) { - this.unexpected(); + return node; } -}; - -pp.flowParseQualifiedTypeIdentifier = function (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"); - } + flowParseGenericType(startPos: number, startLoc: Position, id: N.Identifier): N.FlowGenericTypeAnnotation { + const node = this.startNodeAt(startPos, startLoc); - return node; -}; + node.typeParameters = null; + node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); -pp.flowParseGenericType = function (startPos, startLoc, id) { - const node = this.startNodeAt(startPos, startLoc); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } - node.typeParameters = null; - node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); + return this.finishNode(node, "GenericTypeAnnotation"); + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); + flowParseTypeofType(): N.FlowTypeofTypeAnnotation { + const node = this.startNode(); + this.expect(tt._typeof); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); } - return this.finishNode(node, "GenericTypeAnnotation"); -}; + flowParseTupleType(): N.FlowTupleTypeAnnotation { + 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.flowParseTypeofType = function () { - const node = this.startNode(); - this.expect(tt._typeof); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); -}; + flowParseFunctionTypeParam(): N.FlowFunctionTypeParam { + 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(); + } + node.name = name; + node.optional = optional; + node.typeAnnotation = typeAnnotation; + return this.finishNode(node, "FunctionTypeParam"); + } -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"); -}; + reinterpretTypeAsFunctionTypeParam(type: N.FlowType): N.FlowFunctionTypeParam { + const node = this.startNodeAt(type.start, type.loc); + node.name = null; + node.optional = false; + node.typeAnnotation = type; + return this.finishNode(node, "FunctionTypeParam"); + } -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; + flowParseFunctionTypeParams(params: N.FlowFunctionTypeParam[] = []): { params: N.FlowFunctionTypeParam[], rest: ?N.FlowFunctionTypeParam } { + let rest: ?N.FlowFunctionTypeParam = null; + while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) { + params.push(this.flowParseFunctionTypeParam()); + if (!this.match(tt.parenR)) { + this.expect(tt.comma); + } + } + if (this.eat(tt.ellipsis)) { + rest = this.flowParseFunctionTypeParam(); } - typeAnnotation = this.flowParseTypeInitialiser(); - } else { - typeAnnotation = this.flowParseType(); + return { params, rest }; } - 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"); -}; + flowIdentToTypeAnnotation(startPos: number, startLoc: Position, node: N.FlowTypeAnnotation, id: N.Identifier): N.FlowTypeAnnotation { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); -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); + case "void": + return this.finishNode(node, "VoidTypeAnnotation"); + + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); + + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); + + case "empty": + return this.finishNode(node, "EmptyTypeAnnotation"); + + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); + + case "string": + return this.finishNode(node, "StringTypeAnnotation"); + + default: + return this.flowParseGenericType(startPos, startLoc, id); } } - 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"); + // 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(): N.FlowTypeAnnotation { + 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); - case "void": - return this.finishNode(node, "VoidTypeAnnotation"); + node.returnType = this.flowParseType(); - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + break; - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); + case tt.parenL: + this.next(); - case "empty": - return this.finishNode(node, "EmptyTypeAnnotation"); + // 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; + } + } - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); + if (isGroupedType) { + this.state.noAnonFunctionType = false; + type = this.flowParseType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; - case "string": - return this.finishNode(node, "StringTypeAnnotation"); + // 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); + } + } - default: - return this.flowParseGenericType(startPos, startLoc, id); - } -}; + if (type) { + tmp = this.flowParseFunctionTypeParams( + [this.reinterpretTypeAsFunctionTypeParam(type)], + ); + } else { + tmp = this.flowParseFunctionTypeParams(); + } -// 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); - - case tt.braceBarL: - return this.flowParseObjectType(false, 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); node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); - } - break; - case tt.parenL: - this.next(); + case tt.string: + return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); - // 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; - } - } + case tt._true: case tt._false: + node.value = this.match(tt._true); + this.next(); + return this.finishNode(node, "BooleanLiteralTypeAnnotation"); - if (isGroupedType) { - this.state.noAnonFunctionType = false; - type = this.flowParseType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; + case tt.plusMin: + if (this.state.value === "-") { + this.next(); + if (!this.match(tt.num)) this.unexpected(null, "Unexpected token, expected number"); - // 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); + return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); } - } - if (type) { - tmp = this.flowParseFunctionTypeParams( - [this.reinterpretTypeAsFunctionTypeParam(type)], - ); - } else { - tmp = this.flowParseFunctionTypeParams(); - } - - node.params = tmp.params; - node.rest = tmp.rest; - - this.expect(tt.parenR); - - this.expect(tt.arrow); - - node.returnType = this.flowParseType(); + this.unexpected(); + case tt.num: + return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); - node.typeParameters = null; - - return this.finishNode(node, "FunctionTypeAnnotation"); - - 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.plusMin: - if (this.state.value === "-") { + case tt._null: + node.value = this.match(tt._null); this.next(); - if (!this.match(tt.num)) this.unexpected(null, "Unexpected token, expected number"); - - return this.parseLiteral(-this.state.value, "NumericLiteralTypeAnnotation", node.start, node.loc.start); - } - - this.unexpected(); - case tt.num: - return this.parseLiteral(this.state.value, "NumericLiteralTypeAnnotation"); + 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, "ExistentialTypeParam"); + default: + if (this.state.type.keyword === "typeof") { + return this.flowParseTypeofType(); + } + } - default: - if (this.state.type.keyword === "typeof") { - return this.flowParseTypeofType(); - } + throw 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(): N.FlowTypeAnnotation { + 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(): N.FlowTypeAnnotation { + 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(): 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; + 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(): N.FlowTypeAnnotation { + 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(): N.FlowTypeAnnotation { + 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; -}; - -pp.flowParseTypeAnnotation = function () { - const node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); -}; + flowParseType(): N.FlowTypeAnnotation { + const oldInType = this.state.inType; + this.state.inType = true; + const type = this.flowParseUnionType(); + this.state.inType = oldInType; + return type; + } -pp.flowParseTypeAndPredicateAnnotation = function () { - const node = this.startNode(); - [node.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - return this.finishNode(node, "TypeAnnotation"); -}; + flowParseTypeAnnotation(): N.FlowTypeAnnotation { + 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(): N.Identifier { + 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: N.Node): N.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)) { - if (this.state.value === "+") { - variance = "plus"; - } else if (this.state.value === "-") { - variance = "minus"; + flowParseVariance(): ?N.FlowVariance { + 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(); + return variance; } - return variance; -}; -export default function (instance) { + // ================================== + // Overrides + // ================================== + // 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 - node.returnType = this.flowParseTypeAndPredicateAnnotation(); - } + 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 + ? 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: 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(); + 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: 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)) { + 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(): boolean { + return this.isContextual("type") + || this.isContextual("interface") + || super.shouldParseExportDeclaration(); + } + + 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)) { + 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: N.Expression, startPos: number, startLoc: Position): N.Expression { + 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: N.ExportNamedDeclaration): N.ExportNamedDeclaration { + node = super.parseExport(node); + if (node.type === "ExportNamedDeclaration") { + node.exportKind = node.exportKind || "value"; + } + return node; + } - const declarationNode = this.startNode(); - this.next(); + parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration { + 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); } - }; - }); - - instance.extend("parseClassId", function (inner) { - return function (node) { - inner.apply(this, arguments); - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - }; - }); + } else if (this.isContextual("interface")) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseInterface(declarationNode); + } else { + return super.parseExportDeclaration(node); + } + } + + parseClassId(node: N.Class, ...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: string): boolean { + 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)) { - - // short-circuit for `<-` and ` { + 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: $ReadOnlyArray): $ReadOnlyArray { + 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): ?N.Expression { + 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: N.Expression, ...args): void { + if (node.type !== "TypeCastExpression") { + return super.checkLVal(node, ...args); + } + } // 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(); - } - return inner.call(this, node); - }; - }); + parseClassProperty(node: N.ClassProperty): N.ClassProperty { + 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 + isClassMethod(): boolean { + 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(): boolean { + 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.variancePos); - } - delete method.variance; - delete method.variancePos; - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } + parseClassMethod(classBody: N.ClassBody, method: N.ClassMethod, ...args): void { + 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)); - } - }; - }); + parseClassSuper(node: N.Class, isStatement?: boolean): void { + 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)); + } + } - 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; - }; - }); + parsePropertyName(node: N.ObjectMember): N.Identifier { + const variance = this.flowParseVariance(); + const key = super.parsePropertyName(node); + node.variance = variance; + return key; + } // parse type parameters for object method shorthand - instance.extend("parseObjPropValue", function (inner) { - return function (prop) { - if (prop.variance) { - this.unexpected(prop.variancePos); - } - delete prop.variance; - delete prop.variancePos; - - let typeParameters; + parseObjPropValue(prop: N.ObjectMember, ...args): void { + 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) { + // $FlowFixMe (trying to set '.typeParameters' on an expression) + (prop.value || prop).typeParameters = typeParameters; + } + } - instance.extend("parseMaybeDefault", function (inner) { - return function (...args) { - const node = inner.apply(this, args); + parseAssignableListItemTypes(param: N.Pattern): N.Pattern { + 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): N.Pattern { + 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: N.ImportDeclaration): void { + 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: N.ImportDeclaration): void { + 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: N.NormalFunction): void { + 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: N.VariableDeclarator): void { + 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: N.ArrowFunctionExpression, call: N.CallExpression): N.ArrowFunctionExpression { + 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(): boolean { + 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 @@ -1362,101 +1449,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): N.Expression { + 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; + + // 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 + throw err; } } + } - // 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("<")) { - let arrowExpression; - let typeParameters; - try { - typeParameters = this.flowParseTypeParameterDeclaration(); - - arrowExpression = inner.apply(this, args); - arrowExpression.typeParameters = typeParameters; - arrowExpression.start = typeParameters.start; - arrowExpression.loc.start = typeParameters.loc.start; - } catch (err) { - throw jsxError || err; - } + if (jsxError != null || this.isRelational("<")) { + let arrowExpression; + let typeParameters; + try { + typeParameters = this.flowParseTypeParameterDeclaration(); - 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", - ); - } + arrowExpression = super.parseMaybeAssign(...args); + arrowExpression.typeParameters = typeParameters; + this.resetStartLocationFromNode(arrowExpression, typeParameters); + } catch (err) { + throw jsxError || err; } - this.state.context.pop(); - return inner.apply(this, args); - }; - }); + 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 returnType = this.flowParseTypeAndPredicateAnnotation(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; + parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression { + if (this.match(tt.colon)) { + const state = this.state.clone(); + try { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; - if (this.canInsertSemicolon()) this.unexpected(); - if (!this.match(tt.arrow)) this.unexpected(); - // assign after it is clear it is an arrow - node.returnType = returnType; - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - } else { - // istanbul ignore next: no such error is expected - throw err; - } - } - } + const typeNode = this.startNode(); + // $FlowFixMe (destructuring not supported yet) + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - return inner.call(this, node); - }; - }); + this.state.noAnonFunctionType = oldNoAnonFunctionType; - instance.extend("shouldParseArrow", function (inner) { - return function () { - return this.match(tt.colon) || inner.call(this); - }; - }); + if (this.canInsertSemicolon()) this.unexpected(); + if (!this.match(tt.arrow)) this.unexpected(); - instance.extend("isClassMutatorStarter", function (inner) { - return function () { - if (this.isRelational("<")) { - return true; - } else { - return inner.call(this); + // 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 super.parseArrow(node); + } + + shouldParseArrow(): boolean { + return this.match(tt.colon) || super.shouldParseArrow(); + } +}; 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 de13289e38..f7c1e795b6 100644 --- a/src/plugins/jsx/index.js +++ b/src/plugins/jsx/index.js @@ -1,10 +1,12 @@ -import fromCodePoint from "./fromCodePoint"; +// @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 Parser from "../../parser"; +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]+$/; @@ -35,470 +37,466 @@ tt.jsxTagEnd.updateContext = function(prevType) { } }; -const pp = Parser.prototype; +// Transforms JSX element name to string. -// Reads inline JSX contents token. +function getQualifiedJSXName(object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression): string { + 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); + // istanbul ignore next + throw new Error("Node had unexpected type: " + object.type); +} - case 38: // "&" - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - break; +export default (superClass: Class): Class => class extends superClass { + // Reads inline JSX contents token. - default: - if (isNewLine(ch)) { + jsxReadToken(): void { + let out = ""; + let chunkStart = this.state.pos; + for (;;) { + if (this.state.pos >= this.input.length) { + this.raise(this.state.start, "Unterminated JSX contents"); + } + + 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); + + 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; -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) { - ++this.state.pos; - out = normalizeCRLF ? "\n" : "\r\n"; - } else { - out = String.fromCharCode(ch); - } - ++this.state.curLine; - this.state.lineStart = this.state.pos; - - // DUP in `Tokenizer.skipSpace()` - if (this.hasPlugin("lightscript")) { - this.state.indentLevel = 0; - while (this.input.charCodeAt(this.state.pos) === 32) { - if (this.input.charCodeAt(this.state.pos + 1) === 32) { - ++this.state.pos; - ++this.state.pos; - ++this.state.indentLevel; - out += " "; - } else { - 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; + } } } } - 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"); - } - + jsxReadNewLine(normalizeCRLF: boolean): string { 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 { + let out; + ++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); } - } - 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 = fromCodePoint(parseInt(str, 16)); + ++this.state.curLine; + this.state.lineStart = this.state.pos; + + // DUP in `Tokenizer.skipSpace()` + if (this.hasPlugin("lightscript")) { + this.state.indentLevel = 0; + while (this.input.charCodeAt(this.state.pos) === 32) { + if (this.input.charCodeAt(this.state.pos + 1) === 32) { + ++this.state.pos; + ++this.state.pos; + ++this.state.indentLevel; + out += " "; } else { - str = str.substr(1); - if (DECIMAL_NUMBER.test(str)) - entity = fromCodePoint(parseInt(str, 10)); + break; } - } else { - entity = XHTMLEntities[str]; } - break; } - 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; + return out; } - if (object.type === "JSXNamespacedName") { - return object.namespace.name + ":" + object.name.name; - } + jsxReadString(quote: number): void { + let out = ""; + let chunkStart = ++this.state.pos; + for (;;) { + if (this.state.pos >= this.input.length) { + this.raise(this.state.start, "Unterminated string constant"); + } - if (object.type === "JSXMemberExpression") { - return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + 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); } -} - -// 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(); + jsxReadEntity(): string { + 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 { + entity = XHTMLEntities[str]; + } + break; + } + str += ch; + } + if (!entity) { + this.state.pos = startPos; + return "&"; + } + return entity; } - this.next(); - return this.finishNode(node, "JSXIdentifier"); -}; -// 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; + // 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(): void { + 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)); + } - const node = this.startNodeAt(startPos, startLoc); - node.namespace = name; - node.name = this.jsxParseIdentifier(); - return this.finishNode(node, "JSXNamespacedName"); -}; + // Parse next token as JSX identifier -// 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"); + jsxParseIdentifier(): N.JSXIdentifier { + 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"); } - return node; -}; -// Parses any type of JSX attribute value. + // Parse namespaced identifier. -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; - } + jsxParseNamespacedName(): N.JSXNamespacedName { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const name = this.jsxParseIdentifier(); + if (!this.eat(tt.colon)) return name; - case tt.jsxTagStart: - case tt.string: - node = this.parseExprAtom(); - node.extra = null; - return node; + const node = this.startNodeAt(startPos, startLoc); + node.namespace = name; + node.name = this.jsxParseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); + } - default: - this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); + // Parses element name in any form - namespaced, member + // or single identifier. + + jsxParseElementName(): N.JSXNamespacedName | N.JSXMemberExpression { + 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; } -}; -// 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). + // Parses any type of JSX attribute value. -pp.jsxParseEmptyExpression = function() { - const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc); - return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc); -}; + jsxParseAttributeValue(): N.Expression { + let node; + switch (this.state.type) { + case tt.braceL: + node = this.jsxParseExpressionContainer(); + if (node.expression.type === "JSXEmptyExpression") { + throw this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); + } else { + return node; + } -// Parse JSX spread child + case tt.jsxTagStart: + case tt.string: + return this.parseExprAtom(); -pp.jsxParseSpreadChild = function() { - const node = this.startNode(); - this.expect(tt.braceL); - this.expect(tt.ellipsis); - node.expression = this.parseExpression(); - this.expect(tt.braceR); + default: + throw this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); + } + } - return this.finishNode(node, "JSXSpreadChild"); -}; + // 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). -// Parses JSX expression enclosed into curly brackets. + 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 -pp.jsxParseExpressionContainer = function() { - const node = this.startNode(); - this.next(); - if (this.match(tt.braceR)) { - node.expression = this.jsxParseEmptyExpression(); - } else { + jsxParseSpreadChild(): N.JSXSpreadChild { + 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(): N.JSXExpressionContainer { + 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(): N.JSXAttribute { + 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. -pp.jsxParseElement = function() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - this.next(); - return this.jsxParseElementAt(startPos, startLoc); -}; + jsxParseElement(): N.JSXElement { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + this.next(); + return this.jsxParseElementAt(startPos, startLoc); + } -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; - } else if (this.match(tt.jsxTagStart)) { - return this.jsxParseElement(); - } else { - return inner.call(this, refShortHandDefaultPos); - } - }; - }); + // ================================== + // Overrides + // ================================== - instance.extend("readToken", function(inner) { - return function(code) { - if (this.state.inPropertyName) return inner.call(this, code); + parseExprAtom(refShortHandDefaultPos: ?Pos): N.Expression { + 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); + } + } - const context = this.curContext(); + readToken(code: number): void { + if (this.state.inPropertyName) return super.readToken(code); - if (this.hasPlugin("lightscript") && code === 60) { - const next = this.state.input.charCodeAt(this.state.pos + 1); + const context = this.curContext(); - // short-circuit for `<-` and ` 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: TokenType): void { + 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); + } + } +}; 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; diff --git a/src/plugins/lightscript.js b/src/plugins/lightscript.js index 30d4b3e114..40d008b81e 100644 --- a/src/plugins/lightscript.js +++ b/src/plugins/lightscript.js @@ -1,56 +1,6 @@ import Parser from "../parser"; import { types as tt } from "../tokenizer/types"; -const pp = Parser.prototype; - -pp.isColonConstAssign = function (expr) { - if (expr.type !== "AssignmentExpression") return false; - if (expr.left.type === "MemberExpression") return false; - if (expr.isNowAssign !== false) return false; - - return ( - expr.operator === "=" || expr.operator === "<-" || expr.operator === "): Class => class extends superClass { - this.next(); - node[iterType] = iterType === "elem" || iterType === "val" - ? this.parseBindingAtom() - : this.parseBindingIdentifier(); - return MATCHING_ITER_VARS[iterType]; -}; + isColonConstAssign(expr) { + if (expr.type !== "AssignmentExpression") return false; + if (expr.left.type === "MemberExpression") return false; + if (expr.isNowAssign !== false) return false; -pp.parseEnhancedForIn = function (node) { - const matchingIterationType = this.parseForInIterationVariable(node); - if (this.eat(tt.comma)) { - this.parseForInIterationVariable(node, matchingIterationType); + return ( + expr.operator === "=" || expr.operator === "<-" || expr.operator === " false -// x\ny -> true -// x\n y -> false + // Arguably one of the hackiest parts of LightScript so far. + seemsLikeStatementStart() { + const lastTok = this.state.tokens[this.state.tokens.length - 1]; + if (lastTok && lastTok.type === tt.semi) return true; + if (lastTok && lastTok.type === tt.braceR) return true; -pp.isNonIndentedBreakFrom = function (pos) { - const indentLevel = this.indentLevelAt(pos); - return this.isLineBreak() && this.state.indentLevel <= indentLevel; -}; + // This is not accurate; could easily be a continuation of a previous expression. + if (this.isLineBreak()) return true; + } -// walk backwards til newline or start-of-file. -// if two consecutive spaces are found together, increment indents. -// if non-space found, reset indentation. - -pp.indentLevelAt = function (pos) { - let indents = 0; - while (pos > 0 && this.state.input[pos] !== "\n") { - if (this.state.input[pos--] === " ") { - if (this.state.input[pos] === " ") { - --pos; - ++indents; + isFollowedByLineBreak() { + const end = this.state.input.length; + + let pos = this.state.pos; + while (pos < end) { + const code = this.state.input.charCodeAt(pos); + if (code === 10) { + return true; + } else if (code === 32 || code === 13) { + ++pos; + continue; + } else { + return false; } - } else { - indents = 0; } } - return indents; -}; -pp.parseArrowType = function (node) { - if (!this.match(tt.arrow)) return; - const val = this.state.value; - - // validations - const isPlainFatArrow = val === "=>" && !node.id && !node.key; - if (node.async && !isPlainFatArrow) this.unexpected(node.start, "Can't use async with lightscript arrows."); - if (node.generator) this.unexpected(node.start, "Can't declare generators with arrows; try -*> instead."); - if (node.kind === "get") this.unexpected(node.start, "Can't use arrow method with get; try -get> instead."); - if (node.kind === "set") this.unexpected(node.start, "Can't use arrow method with set; try -set> instead."); - if (node.kind === "constructor" && val !== "->") this.unexpected(null, "Can only use -> with constructor."); - - switch (val) { - case "=/>": case "-/>": - node.async = true; - break; - case "=*>": case "-*>": - node.generator = true; - break; - case "-get>": - // TODO: validate that it's in a method not a function - if (!node.kind) this.unexpected(null, "Only methods can be getters."); - node.kind = "get"; - break; - case "-set>": - if (!node.kind) this.unexpected(null, "Only methods can be setters."); - node.kind = "set"; - break; - case "=>": case "->": - break; - default: - this.unexpected(); + // detect whether we're on a (non-indented) newline + // relative to another position, eg; + // x y -> false + // x\ny -> true + // x\n y -> false + isNonIndentedBreakFrom(pos) { + const indentLevel = this.indentLevelAt(pos); + return this.isLineBreak() && this.state.indentLevel <= indentLevel; } - if (val[0] === "-") { - node.skinny = true; - } else if (val[0] === "=") { - node.skinny = false; - } else { - this.unexpected(); + // walk backwards til newline or start-of-file. + // if two consecutive spaces are found together, increment indents. + // if non-space found, reset indentation. + indentLevelAt(pos) { + let indents = 0; + while (pos > 0 && this.state.input[pos] !== "\n") { + if (this.state.input[pos--] === " ") { + if (this.state.input[pos] === " ") { + --pos; + ++indents; + } + } else { + indents = 0; + } + } + return indents; } -}; -// largely c/p from parseFunctionBody + parseArrowType(node) { + if (!this.match(tt.arrow)) return; + const val = this.state.value; -pp.parseArrowFunctionBody = function (node) { - // set and reset state surrounding block - const oldInAsync = this.state.inAsync, - oldInGen = this.state.inGenerator, - oldLabels = this.state.labels, - oldInFunc = this.state.inFunction; - this.state.inAsync = node.async; - this.state.inGenerator = node.generator; - this.state.labels = []; - this.state.inFunction = true; + // validations + const isPlainFatArrow = val === "=>" && !node.id && !node.key; + if (node.async && !isPlainFatArrow) { + this.unexpected(node.start, "Can't use async with lightscript arrows."); + } + if (node.generator) { + this.unexpected(node.start, "Can't declare generators with arrows; try -*> instead."); + } + if (node.kind === "get") { + this.unexpected(node.start, "Can't use arrow method with get; try -get> instead."); + } + if (node.kind === "set") { + this.unexpected(node.start, "Can't use arrow method with set; try -set> instead."); + } + if (node.kind === "constructor" && val !== "->") { + this.unexpected(null, "Can only use -> with constructor."); + } - node.body = this.parseWhiteBlock(true); + switch (val) { + case "=/>": case "-/>": + node.async = true; + break; + case "=*>": case "-*>": + node.generator = true; + break; + case "-get>": + // TODO: validate that it's in a method not a function + if (!node.kind) this.unexpected(null, "Only methods can be getters."); + node.kind = "get"; + break; + case "-set>": + if (!node.kind) this.unexpected(null, "Only methods can be setters."); + node.kind = "set"; + break; + case "=>": case "->": + break; + default: + this.unexpected(); + } - if (node.body.type !== "BlockStatement") { - node.expression = true; + if (val[0] === "-") { + node.skinny = true; + } else if (val[0] === "=") { + node.skinny = false; + } else { + this.unexpected(); + } } - this.state.inAsync = oldInAsync; - this.state.inGenerator = oldInGen; - this.state.labels = oldLabels; - this.state.inFunction = oldInFunc; + // largely c/p from parseFunctionBody + parseArrowFunctionBody(node) { + // set and reset state surrounding block + const oldInAsync = this.state.inAsync, + oldInGen = this.state.inGenerator, + oldLabels = this.state.labels, + oldInFunc = this.state.inFunction; + this.state.inAsync = node.async; + this.state.inGenerator = node.generator; + this.state.labels = []; + this.state.inFunction = true; + + node.body = this.parseWhiteBlock(true); + + if (node.body.type !== "BlockStatement") { + node.expression = true; + } - this.validateFunctionBody(node, true); -}; + this.state.inAsync = oldInAsync; + this.state.inGenerator = oldInGen; + this.state.labels = oldLabels; + this.state.inFunction = oldInFunc; -pp.parseNamedArrowFromCallExpression = function (node, call) { - this.initFunction(node); - node.params = this.toAssignableList(call.arguments, true, "named arrow function parameters"); - if (call.typeParameters) node.typeParameters = call.typeParameters; - - let isMember; - if (call.callee.type === "Identifier") { - node.id = call.callee; - isMember = false; - } else if (call.callee.type === "MemberExpression") { - node.id = call.callee.property; - node.object = call.callee.object; - isMember = true; - } else { - this.unexpected(); - } - - if (this.match(tt.colon)) { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - node.returnType = this.flowParseTypeAnnotation(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - } - if (this.canInsertSemicolon()) this.unexpected(); - - this.check(tt.arrow); - this.parseArrowType(node); - this.parseArrowFunctionBody(node); - - // may be later rewritten as "NamedArrowDeclaration" in parseStatement - return this.finishNode(node, isMember ? "NamedArrowMemberExpression" : "NamedArrowExpression"); -}; + this.validateFunctionBody(node, true); + } -pp.pushBlockState = function (blockType, indentLevel) { - this.state.blockStack.push({ blockType, indentLevel }); -}; + parseNamedArrowFromCallExpression(node, call) { + this.initFunction(node); + node.params = this.toAssignableList(call.arguments, true, "named arrow function parameters"); + if (call.typeParameters) node.typeParameters = call.typeParameters; + + let isMember; + if (call.callee.type === "Identifier") { + node.id = call.callee; + isMember = false; + } else if (call.callee.type === "MemberExpression") { + node.id = call.callee.property; + node.object = call.callee.object; + isMember = true; + } else { + this.unexpected(); + } -pp.matchBlockState = function(blockType, indentLevel) { - return this.state.blockStack.some( (x) => x.blockType === blockType && x.indentLevel === indentLevel ); -}; + if (this.match(tt.colon)) { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + node.returnType = this.flowParseTypeAnnotation(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + } + if (this.canInsertSemicolon()) this.unexpected(); -pp.popBlockState = function() { - this.state.blockStack.pop(); -}; + this.check(tt.arrow); + this.parseArrowType(node); + this.parseArrowFunctionBody(node); -// c/p parseIfStatement + // may be later rewritten as "NamedArrowDeclaration" in parseStatement + return this.finishNode(node, isMember ? "NamedArrowMemberExpression" : "NamedArrowExpression"); + } -pp.parseIf = function (node, isExpression) { - const indentLevel = this.state.indentLevel; - this.next(); - node.test = this.parseParenExpression(); + pushBlockState(blockType, indentLevel) { + this.state.blockStack.push({ blockType, indentLevel }); + } - const isColon = this.match(tt.colon); - if (isColon) this.pushBlockState("if", indentLevel); + matchBlockState(blockType, indentLevel) { + return this.state.blockStack.some((x) => x.blockType === blockType && x.indentLevel === indentLevel); + } - if (isExpression) { - if (this.match(tt.braceL)) { - node.consequent = this.parseBlock(false); - } else if (!isColon) { - node.consequent = this.parseMaybeAssign(); - } else { - node.consequent = this.parseWhiteBlock(false, true); - } - } else { - node.consequent = this.parseStatement(false); + popBlockState() { + this.state.blockStack.pop(); } - node.alternate = this.parseIfAlternate(node, isExpression, isColon, indentLevel); + // c/p parseIfStatement + parseIf(node, isExpression) { + const indentLevel = this.state.indentLevel; + this.next(); + node.test = this.parseParenExpression(); - if (isColon) this.popBlockState(); + const isColon = this.match(tt.colon); + if (isColon) this.pushBlockState("if", indentLevel); - return this.finishNode(node, isExpression ? "IfExpression" : "IfStatement"); -}; + if (isExpression) { + if (this.match(tt.braceL)) { + node.consequent = this.parseBlock(false); + } else if (!isColon) { + node.consequent = this.parseMaybeAssign(); + } else { + node.consequent = this.parseWhiteBlock(false, true); + } + } else { + node.consequent = this.parseStatement(false); + } -pp.parseIfAlternate = function (node, isExpression, ifIsWhiteBlock, ifIndentLevel) { - if (!this.match(tt._elif) && !this.match(tt._else)) return null; - - // If the indent level here doesn't match with the current whiteblock `if`, or - // it matches with a whiteblock `if` higher on the stack, then this alternate - // clause does not match the current `if` -- so unwind the recursive descent. - const alternateIndentLevel = this.state.indentLevel; - if ( - (alternateIndentLevel !== ifIndentLevel) && - (ifIsWhiteBlock || this.matchBlockState("if", alternateIndentLevel)) - ) { - return null; - } + node.alternate = this.parseIfAlternate(node, isExpression, isColon, indentLevel); + + if (isColon) this.popBlockState(); - if (this.match(tt._elif)) { - return this.parseIf(this.startNode(), isExpression); + return this.finishNode(node, isExpression ? "IfExpression" : "IfStatement"); } - if (this.eat(tt._else)) { - if (this.match(tt._if)) { - if (this.isLineBreak()) { - this.unexpected(this.state.lastTokEnd, "Illegal newline."); - } - return this.parseIf(this.startNode(), isExpression); + parseIfAlternate(node, isExpression, ifIsWhiteBlock, ifIndentLevel) { + if (!this.match(tt._elif) && !this.match(tt._else)) return null; + + // If the indent level here doesn't match with the current whiteblock `if`, or + // it matches with a whiteblock `if` higher on the stack, then this alternate + // clause does not match the current `if` -- so unwind the recursive descent. + const alternateIndentLevel = this.state.indentLevel; + if ( + (alternateIndentLevel !== ifIndentLevel) && + (ifIsWhiteBlock || this.matchBlockState("if", alternateIndentLevel)) + ) { + return null; } - if (this.isLineBreak()) { - this.unexpected(this.state.lastTokEnd, tt.colon); + if (this.match(tt._elif)) { + return this.parseIf(this.startNode(), isExpression); } - if (isExpression) { - if (this.match(tt.braceL)) { - return this.parseBlock(false); - } else if (!this.match(tt.colon)) { - return this.parseMaybeAssign(); - } else { - return this.parseWhiteBlock(false, true); + if (this.eat(tt._else)) { + if (this.match(tt._if)) { + if (this.isLineBreak()) { + this.unexpected(this.state.lastTokEnd, "Illegal newline."); + } + return this.parseIf(this.startNode(), isExpression); } - } - return this.parseStatement(false); - } + if (this.isLineBreak()) { + this.unexpected(this.state.lastTokEnd, tt.colon); + } - return null; -}; + if (isExpression) { + if (this.match(tt.braceL)) { + return this.parseBlock(false); + } else if (!this.match(tt.colon)) { + return this.parseMaybeAssign(); + } else { + return this.parseWhiteBlock(false, true); + } + } -pp.parseIfExpression = function (node) { - return this.parseIf(node, true); -}; + return this.parseStatement(false); + } + return null; + } -// c/p parseAwait + parseIfExpression(node) { + return this.parseIf(node, true); + } -pp.parseSafeAwait = function (node) { - if (!this.state.inAsync) this.unexpected(); - node.argument = this.parseMaybeUnary(); - return this.finishNode(node, "SafeAwaitExpression"); -}; -pp.isAwaitArrowAssign = function (expr) { - return ( - expr.type === "AssignmentExpression" && - (expr.operator === "<-" || expr.operator === "() ->` + if (this.hasPlugin("flow") && this.isRelational("<")) { + try { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } catch (err) { + return null; + } + } - // parse eg; `fn() ->` - if (this.hasPlugin("flow") && this.isRelational("<")) { + if (!this.eat(tt.parenL)) return null; try { - node.typeParameters = this.flowParseTypeParameterDeclaration(); + call.arguments = this.parseCallExpressionArguments(tt.parenR, false); } catch (err) { return null; } - } - if (!this.eat(tt.parenL)) return null; - try { - call.arguments = this.parseCallExpressionArguments(tt.parenR, false); - } catch (err) { - return null; - } + if (!this.shouldParseArrow()) return null; + node = this.parseNamedArrowFromCallExpression(node, call); - if (!this.shouldParseArrow()) return null; - node = this.parseNamedArrowFromCallExpression(node, call); + // Declaration, not Expression + node.type = "NamedArrowDeclaration"; + return node; + } - // Declaration, not Expression - node.type = "NamedArrowDeclaration"; - return node; -}; + isBitwiseOp() { + return ( + this.match(tt.bitwiseOR) || + this.match(tt.bitwiseAND) || + this.match(tt.bitwiseXOR) || + this.match(tt.bitShift) + ); + } -pp.isBitwiseOp = function () { - return ( - this.match(tt.bitwiseOR) || - this.match(tt.bitwiseAND) || - this.match(tt.bitwiseXOR) || - this.match(tt.bitShift) - ); -}; + // ================================== + // Overrides + // ================================== -export default function (instance) { // if, switch, while, with --> don't need no stinkin' parens no more + parseParenExpression() { + if (this.isLineBreak()) { + this.unexpected(this.state.lastTokEnd, "Illegal newline."); + } - instance.extend("parseParenExpression", function (inner) { - return function () { - if (this.isLineBreak()) { - this.unexpected(this.state.lastTokEnd, "Illegal newline."); - } - - // parens are special here; they might be `if (x) -1` or `if (x < 1) and y: -1` - if (this.match(tt.parenL)) { - const state = this.state.clone(); - - // first, try paren-free style - try { - const val = this.parseExpression(); - if (this.match(tt.braceL) || this.match(tt.colon)) { - if (val.extra && val.extra.parenthesized) { - delete val.extra.parenthesized; - delete val.extra.parenStart; - } - return val; + // parens are special here; they might be `if (x) -1` or `if (x < 1) and y: -1` + if (this.match(tt.parenL)) { + const state = this.state.clone(); + + // first, try paren-free style + try { + const val = this.parseExpression(); + if (this.match(tt.braceL) || this.match(tt.colon)) { + if (val.extra && val.extra.parenthesized) { + delete val.extra.parenthesized; + delete val.extra.parenStart; } - } catch (_err) { - // fall-through, will re-raise if it's an error below + return val; } - - // otherwise, try traditional parseParenExpression - this.state = state; - return inner.apply(this, arguments); + } catch (_err) { + // fall-through, will re-raise if it's an error below } - const val = this.parseExpression(); - this.expectParenFreeBlockStart(); - return val; - }; - }); + // otherwise, try traditional parseParenExpression + this.state = state; + return super.parseParenExpression(...arguments); + } + + const val = this.parseExpression(); + this.expectParenFreeBlockStart(); + return val; + } // `export` is the only time auto-const and can be preceded by a non-newline, // and has a bunch of weird parsing rules generally. - - instance.extend("parseExport", function (inner) { - return function (node) { - let state = this.state.clone(); - - // first try NamedArrowDeclaration - // eg; `export fn() -> 1`, `export fn(x: T): T -> x` - this.next(); - if (this.match(tt.name)) { - const decl = this.tryParseNamedArrowDeclaration(); - if (decl) { - node.specifiers = []; - node.source = null; - node.declaration = decl; - this.checkExport(node, true); - return this.finishNode(node, "ExportNamedDeclaration"); - } + parseExport(node) { + if (this.isContextual("type") || this.isContextual("interface")) { + return super.parseExport(...arguments); + } + let state = this.state.clone(); + + // first try NamedArrowDeclaration + // eg; `export fn() -> 1`, `export fn(x: T): T -> x` + this.next(); + if (this.match(tt.name)) { + const decl = this.tryParseNamedArrowDeclaration(); + if (decl) { + node.specifiers = []; + node.source = null; + node.declaration = decl; + this.checkExport(node, true); + return this.finishNode(node, "ExportNamedDeclaration"); } + } - // wasn't a NamedArrowDeclaration, reset. - this.state = state; - state = this.state.clone(); - - // next, try auto-const - // eg; `export x = 7`, `export { x, y }: Point = a` - this.next(); - if (this.match(tt.name) || this.match(tt.bracketL) || this.match(tt.braceL)) { - const decl = this.tryParseAutoConst(); - if (decl) { - node.specifiers = []; - node.source = null; - node.declaration = decl; - this.checkExport(node, true); - return this.finishNode(node, "ExportNamedDeclaration"); - } + // wasn't a NamedArrowDeclaration, reset. + this.state = state; + state = this.state.clone(); + + // next, try auto-const + // eg; `export x = 7`, `export { x, y }: Point = a` + this.next(); + if (this.match(tt.name) || this.match(tt.bracketL) || this.match(tt.braceL)) { + const decl = this.tryParseAutoConst(); + if (decl) { + node.specifiers = []; + node.source = null; + node.declaration = decl; + this.checkExport(node, true); + return this.finishNode(node, "ExportNamedDeclaration"); } + } - this.state = state; - return inner.apply(this, arguments); - }; - }); + this.state = state; + return super.parseExport(...arguments); + } // whitespace following a colon - - instance.extend("parseStatement", function (inner) { - return function () { - if (this.match(tt.colon)) { - return this.parseWhiteBlock(); - } - return inner.apply(this, arguments); - }; - }); + parseStatement() { + if (this.match(tt.colon)) { + return this.parseWhiteBlock(); + } + return super.parseStatement(...arguments); + } // whitespace following a colon + parseBlock(allowDirectives) { + if (this.match(tt.colon)) { + return this.parseWhiteBlock(allowDirectives); + } + const block = super.parseBlock(...arguments); + this.addExtra(block, "curly", true); + return block; + } - instance.extend("parseBlock", function (inner) { - return function (allowDirectives) { - if (this.match(tt.colon)) { - return this.parseWhiteBlock(allowDirectives); - } - const block = inner.apply(this, arguments); - this.addExtra(block, "curly", true); - return block; - }; - }); - - instance.extend("parseIfStatement", function () { - return function (node) { - return this.parseIf(node, false); - }; - }); + parseIfStatement(node) { + return this.parseIf(node, false); + } -} +}; 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/index.js b/src/tokenizer/index.js index c0927925f5..ac3ea1b19b 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -1,9 +1,14 @@ /* 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 LocationParser from "../parser/location"; import { SourceLocation } from "../util/location"; import { lineBreak, lineBreakG, isNewLine, nonASCIIwhitespace } from "../util/whitespace"; import State from "./state"; @@ -13,7 +18,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 +35,7 @@ export class Token { // ## Tokenizer -function codePointToString(code) { +function codePointToString(code: number): string { // UTF-16 Decoding if (code <= 0xFFFF) { return String.fromCharCode(code); @@ -39,15 +44,22 @@ function codePointToString(code) { } } -export default class Tokenizer { - constructor(options, input) { +export default class Tokenizer extends LocationParser { + // Forward-declarations + // parser/util.js + +unexpected: (pos?: ?number, messageOrType?: string | TokenType) => empty; + + isLookahead: boolean; + + constructor(options: Options, input: string) { + super(); 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 +73,7 @@ export default class Tokenizer { // TODO - eat(type) { + eat(type: TokenType): boolean { if (this.match(type)) { this.next(); return true; @@ -72,19 +84,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 +112,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 +123,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 +147,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 +157,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 +165,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 +181,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 +198,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 +213,7 @@ export default class Tokenizer { // Called at the start of the parse and after every token. Skips // whitespace and comments, and. - skipSpace() { + skipSpace(): void { let isNewLine = false; // for lightscript loop: while (this.state.pos < this.input.length) { const ch = this.input.charCodeAt(this.state.pos); @@ -276,7 +288,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; @@ -295,7 +307,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); // in lightscript, numbers cannot start with a naked `.` if (next >= 48 && next <= 57 && !this.hasPlugin("lightscript")) { @@ -312,7 +324,7 @@ export default class Tokenizer { } } - readToken_slash() { // '/' + readToken_slash(): void { // '/' const looksLikeRegex = this.hasPlugin("lightscript") && this.isLineBreak() && !this.isWhitespaceAt(this.state.pos + 1) && @@ -335,7 +347,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); @@ -354,7 +366,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); @@ -362,7 +374,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); @@ -371,7 +383,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) { @@ -420,7 +432,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; @@ -457,7 +469,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); @@ -488,7 +500,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. @@ -591,13 +603,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; @@ -649,7 +661,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; @@ -674,7 +686,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); @@ -684,9 +696,9 @@ 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 octal = this.input.charCodeAt(this.state.pos) === 48; + let octal = this.input.charCodeAt(start) === 48; // '0' let isFloat = false; // for numeric array access (eg; arr.0), don't read floats (numbers with a decimal). @@ -695,14 +707,17 @@ export default class Tokenizer { this.state.tokens[this.state.tokens.length - 1].type === tt.dot; 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 && !noFloatsAllowed) { // '.' + if (next === 46 && !octal && !noFloatsAllowed) { // '.' ++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"); @@ -712,6 +727,7 @@ export default class Tokenizer { if (this.hasPlugin("lightscript") && this.input.charCodeAt(this.state.pos - 1) === 46) { --this.state.pos; } + if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly after number"); const str = this.input.slice(start, this.state.pos); @@ -720,8 +736,10 @@ export default class Tokenizer { val = parseFloat(str); } else if (!octal || 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); } @@ -730,22 +748,31 @@ export default class Tokenizer { // Read a string value, interpreting backslash-escapes. - readCodePoint() { + readCodePoint(throwOnInvalid: boolean): number | null { 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; } - 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"); @@ -753,6 +780,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 { @@ -766,8 +794,8 @@ export default class Tokenizer { // Reads template string tokens. - readTmplToken() { - let out = "", chunkStart = this.state.pos; + 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"); const ch = this.input.charCodeAt(this.state.pos); @@ -782,11 +810,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); @@ -812,14 +845,21 @@ 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; 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' @@ -831,6 +871,8 @@ export default class Tokenizer { return ""; 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) { @@ -838,12 +880,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; @@ -853,12 +899,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: number, throwOnInvalid: boolean): number | null { 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; } @@ -868,7 +921,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) { @@ -886,11 +939,13 @@ export default class Tokenizer { } ++this.state.pos; - const esc = this.readCodePoint(); + 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"); } + // $FlowFixMe word += codePointToString(esc); chunkStart = this.state.pos; } else { @@ -904,7 +959,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)) { @@ -913,7 +968,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) { @@ -936,7 +991,7 @@ export default class Tokenizer { return !this.state.exprAllowed; } - updateContext(prevType) { + updateContext(prevType: TokenType): void { const type = this.state.type; let update; @@ -948,4 +1003,27 @@ export default class Tokenizer { this.state.exprAllowed = type.beforeExpr; } } + + // added for lightscript: + + isLineBreak(): boolean { + if (this.hasPlugin("lightscript")) { + // treat start-of-file as newline. + // TODO: reconsider/reevaluate + if (!this.state.lastTokEnd) return true; + } + return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); + } + + // lightscript only allows plain space (ascii-32), \r\n, and \n. + // note that the space could appear within a string. + isWhitespaceAt(pos: number) { + const ch = this.state.input.charCodeAt(pos); + return (ch === 32 || ch === 13 || ch === 10); + } + + isNextCharWhitespace() { + return this.isWhitespaceAt(this.state.end); + } + } diff --git a/src/tokenizer/state.js b/src/tokenizer/state.js index e69f12055f..73e08ffbd1 100644 --- a/src/tokenizer/state.js +++ b/src/tokenizer/state.js @@ -54,6 +54,8 @@ export default class State { this.containsEsc = this.containsOctal = false; this.octalPosition = null; + this.invalidTemplateEscapePosition = null; + this.exportedIdentifiers = []; return this; diff --git a/src/tokenizer/types.js b/src/tokenizer/types.js index d30939a578..6af4c7c4c1 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 } = { // LightScript tilde: new TokenType("~"), awaitArrow: new TokenType("<-", { beforeExpr, isAssign }), diff --git a/src/types.js b/src/types.js new file mode 100644 index 0000000000..b42f72a154 --- /dev/null +++ b/src/types.js @@ -0,0 +1,709 @@ +// @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: + optional?: true; + 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 FlowDeclareExportDeclaration = 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 FlowObjectTypeSpreadProperty = 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; diff --git a/src/util/identifier.js b/src/util/identifier.js index 25bbc28d50..bc7f260f2e 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 38137496c1..aaa4ae531c 100644 --- a/src/util/location.js +++ b/src/util/location.js @@ -1,18 +1,32 @@ +// @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 { - constructor(line, col) { + line: number; + column: number; + + constructor(line: number, col: number) { this.line = line; this.column = col; } } export class SourceLocation { - constructor(start, end) { + 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. 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/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/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/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/235/options.lightscript.json b/test/fixtures/core/uncategorised/235/options.lightscript.json index 78b21c5363..4f962dbf55 100644 --- a/test/fixtures/core/uncategorised/235/options.lightscript.json +++ b/test/fixtures/core/uncategorised/235/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:5)" + "throws": "do is a reserved word (1:2)" } \ No newline at end of file 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/esprima/statement-iteration/.migrated_0021/expected.json b/test/fixtures/core/uncategorised/263/expected.lightscript.json similarity index 51% rename from test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json rename to test/fixtures/core/uncategorised/263/expected.lightscript.json index 20d1b7032f..876093b287 100644 --- a/test/fixtures/esprima/statement-iteration/.migrated_0021/expected.json +++ b/test/fixtures/core/uncategorised/263/expected.lightscript.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 25, + "end": 36, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 25 + "column": 36 } }, "program": { "type": "Program", "start": 0, - "end": 25, + "end": 36, "loc": { "start": { "line": 1, @@ -23,151 +23,147 @@ }, "end": { "line": 1, - "column": 25 + "column": 36 } }, "sourceType": "script", "body": [ { - "type": "ForInStatement", - "start": 0, - "end": 25, + "type": "WithStatement", + "start": 17, + "end": 36, "loc": { "start": { "line": 1, - "column": 0 + "column": 17 }, "end": { "line": 1, - "column": 25 + "column": 36 } }, - "left": { + "object": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "x" + }, + "name": "x" + }, + "body": { "type": "VariableDeclaration", - "start": 5, - "end": 18, + "start": 26, + "end": 36, "loc": { "start": { "line": 1, - "column": 5 + "column": 26 }, "end": { "line": 1, - "column": 18 + "column": 36 } }, + "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 18, + "start": 26, + "end": 35, "loc": { "start": { "line": 1, - "column": 9 + "column": 26 }, "end": { "line": 1, - "column": 18 + "column": 35 } }, "id": { "type": "Identifier", - "start": 9, - "end": 10, + "start": 26, + "end": 29, "loc": { "start": { "line": 1, - "column": 9 + "column": 26 }, "end": { "line": 1, - "column": 10 - } + "column": 29 + }, + "identifierName": "foo" }, - "name": "x" + "name": "foo" }, "init": { - "type": "AssignmentExpression", - "start": 13, - "end": 18, + "type": "Identifier", + "start": 32, + "end": 35, "loc": { "start": { "line": 1, - "column": 13 + "column": 32 }, "end": { "line": 1, - "column": 18 - } - }, - "operator": "=", - "left": { - "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - } + "column": 35 }, - "name": "y" + "identifierName": "bar" }, - "right": { - "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "name": "z" - } + "name": "bar" } } - ], - "kind": "var" - }, - "right": { - "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } + ] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 }, - "name": "q" + "end": { + "line": 1, + "column": 16 + } }, - "body": { - "type": "EmptyStatement", - "start": 24, - "end": 25, + "value": { + "type": "DirectiveLiteral", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, - "column": 24 + "column": 0 }, "end": { "line": 1, - "column": 25 + "column": 15 } + }, + "value": "use\\x20strict", + "extra": { + "raw": "'use\\x20strict'", + "rawValue": "use\\x20strict" } } } 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/264/expected.lightscript.json b/test/fixtures/core/uncategorised/264/expected.lightscript.json new file mode 100644 index 0000000000..6fa0a97ff5 --- /dev/null +++ b/test/fixtures/core/uncategorised/264/expected.lightscript.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": "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": "VariableDeclaration", + "start": 26, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "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/303/options.lightscript.json b/test/fixtures/core/uncategorised/303/options.lightscript.json index 5a91ab8f84..8f8b27f3a3 100644 --- a/test/fixtures/core/uncategorised/303/options.lightscript.json +++ b/test/fixtures/core/uncategorised/303/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:6)" + "throws": "var is a reserved word (1:2)" } \ No newline at end of file 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/313/options.lightscript.json b/test/fixtures/core/uncategorised/313/options.lightscript.json index 930a14478b..d641239d26 100644 --- a/test/fixtures/core/uncategorised/313/options.lightscript.json +++ b/test/fixtures/core/uncategorised/313/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:8)" + "throws": "throw is a reserved word (1:2)" } \ 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/314/options.lightscript.json b/test/fixtures/core/uncategorised/314/options.lightscript.json index 930a14478b..d641239d26 100644 --- a/test/fixtures/core/uncategorised/314/options.lightscript.json +++ b/test/fixtures/core/uncategorised/314/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:8)" + "throws": "throw is a reserved word (1:2)" } \ No newline at end of file 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/315/options.lightscript.json b/test/fixtures/core/uncategorised/315/options.lightscript.json index 930a14478b..d641239d26 100644 --- a/test/fixtures/core/uncategorised/315/options.lightscript.json +++ b/test/fixtures/core/uncategorised/315/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:8)" + "throws": "throw is a reserved word (1:2)" } \ No newline at end of file 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/328/expected.lightscript.json b/test/fixtures/core/uncategorised/328/expected.lightscript.json new file mode 100644 index 0000000000..aeff89c54f --- /dev/null +++ b/test/fixtures/core/uncategorised/328/expected.lightscript.json @@ -0,0 +1,116 @@ +{ + "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": "ExpressionStatement", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "properties": [] + } + }, + { + "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/330/expected.lightscript.json b/test/fixtures/core/uncategorised/330/expected.lightscript.json new file mode 100644 index 0000000000..e0347317c5 --- /dev/null +++ b/test/fixtures/core/uncategorised/330/expected.lightscript.json @@ -0,0 +1,100 @@ +{ + "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": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "properties": [] + } + }, + { + "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/331/expected.lightscript.json b/test/fixtures/core/uncategorised/331/expected.lightscript.json new file mode 100644 index 0000000000..23fce6ec2f --- /dev/null +++ b/test/fixtures/core/uncategorised/331/expected.lightscript.json @@ -0,0 +1,149 @@ +{ + "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": "ExpressionStatement", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "properties": [] + } + }, + { + "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/340/expected.lightscript.json b/test/fixtures/core/uncategorised/340/expected.lightscript.json new file mode 100644 index 0000000000..1abded73bc --- /dev/null +++ b/test/fixtures/core/uncategorised/340/expected.lightscript.json @@ -0,0 +1,165 @@ +{ + "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": "ExpressionStatement", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "properties": [] + } + }, + { + "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/esprima/es2015-template-literals/.octal-literal/expected.json b/test/fixtures/core/uncategorised/355/expected.json similarity index 52% rename from test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json rename to test/fixtures/core/uncategorised/355/expected.json index 9ebd9cc590..08de8c762b 100644 --- a/test/fixtures/esprima/es2015-template-literals/.octal-literal/expected.json +++ b/test/fixtures/core/uncategorised/355/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 6, + "end": 2, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 6 + "column": 2 } }, "program": { "type": "Program", "start": 0, - "end": 6, + "end": 2, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 6 + "column": 2 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 6, + "end": 2, "loc": { "start": { "line": 1, @@ -39,13 +39,13 @@ }, "end": { "line": 1, - "column": 6 + "column": 2 } }, "expression": { - "type": "TemplateLiteral", + "type": "NumericLiteral", "start": 0, - "end": 5, + "end": 2, "loc": { "start": { "line": 1, @@ -53,34 +53,17 @@ }, "end": { "line": 1, - "column": 5 + "column": 2 } }, - "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 - } - ] + "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/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/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/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/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/esprima/invalid-syntax/.GH-1106-09/expected.json b/test/fixtures/core/uncategorised/551/expected.json similarity index 76% rename from test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json rename to test/fixtures/core/uncategorised/551/expected.json index 0d183a7bf6..07311dd1eb 100644 --- a/test/fixtures/esprima/invalid-syntax/.GH-1106-09/expected.json +++ b/test/fixtures/core/uncategorised/551/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 5, + "end": 4, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 5 + "column": 4 } }, "program": { "type": "Program", "start": 0, - "end": 5, + "end": 4, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 5 + "column": 4 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 5, + "end": 4, "loc": { "start": { "line": 1, @@ -39,11 +39,11 @@ }, "end": { "line": 1, - "column": 5 + "column": 4 } }, "expression": { - "type": "Literal", + "type": "NumericLiteral", "start": 0, "end": 4, "loc": { @@ -56,11 +56,14 @@ "column": 4 } }, - "value": "9", - "rawValue": "9", - "raw": "\"\\9\"" + "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/es2015/uncategorised/.343/expected.json b/test/fixtures/core/uncategorised/553/expected.json similarity index 83% rename from test/fixtures/es2015/uncategorised/.343/expected.json rename to test/fixtures/core/uncategorised/553/expected.json index dd64dc845d..756da7f491 100644 --- a/test/fixtures/es2015/uncategorised/.343/expected.json +++ b/test/fixtures/core/uncategorised/553/expected.json @@ -43,7 +43,7 @@ } }, "expression": { - "type": "Literal", + "type": "NumericLiteral", "start": 0, "end": 13, "loc": { @@ -56,13 +56,14 @@ "column": 13 } }, - "raw": "/\\u{110000}/u", - "regex": { - "pattern": "\\u{110000}", - "flags": "u" - } + "extra": { + "rawValue": 25257156155, + "raw": "0274134317073" + }, + "value": 25257156155 } } - ] + ], + "directives": [] } } \ No newline at end of file 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)" +} diff --git a/test/fixtures/core/uncategorised/554/options.lightscript.json b/test/fixtures/core/uncategorised/554/options.lightscript.json new file mode 100644 index 0000000000..a6597ff185 --- /dev/null +++ b/test/fixtures/core/uncategorised/554/options.lightscript.json @@ -0,0 +1,3 @@ +{ + "throws": "Numbers with a decimal must end in a number (eg; `1.0`) in LightScript. (1:12)" +} \ No newline at end of file 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/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/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/arrow-functions/object-rest-spread/expected.json b/test/fixtures/es2015/arrow-functions/object-rest-spread/expected.json index 00b780b1c4..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" }, @@ -160,7 +164,7 @@ } }, { - "type": "RestProperty", + "type": "RestElement", "start": 21, "end": 29, "loc": { @@ -185,7 +189,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "other" }, "name": "other" } 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)" +} 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..7094788e97 --- /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, + "computed": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "kind": "get", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 7, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "kind": "set", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 119, + "end": 120, + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 22, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "kind": "get", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 147, + "end": 148, + "loc": { + "start": { + "line": 27, + "column": 2 + }, + "end": { + "line": 27, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "kind": "set", + "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..5a167e4d71 --- /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, + "computed": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "get" + }, + "name": "get" + }, + "kind": "method", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + }, + "identifierName": "set" + }, + "name": "set" + }, + "kind": "method", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 60, + "end": 65, + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 7 + }, + "identifierName": "async" + }, + "name": "async" + }, + "kind": "method", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 87, + "end": 90, + "loc": { + "start": { + "line": 16, + "column": 2 + }, + "end": { + "line": 16, + "column": 5 + }, + "identifierName": "get" + }, + "name": "get" + }, + "kind": "method", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 111, + "end": 114, + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 20, + "column": 5 + }, + "identifierName": "set" + }, + "name": "set" + }, + "kind": "method", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 162, + "end": 167, + "loc": { + "start": { + "line": 28, + "column": 2 + }, + "end": { + "line": 28, + "column": 7 + }, + "identifierName": "async" + }, + "name": "async" + }, + "kind": "method", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 208, + "end": 213, + "loc": { + "start": { + "line": 37, + "column": 2 + }, + "end": { + "line": 37, + "column": 7 + }, + "identifierName": "async" + }, + "name": "async" + }, + "kind": "get", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 241, + "end": 247, + "loc": { + "start": { + "line": 43, + "column": 2 + }, + "end": { + "line": 43, + "column": 8 + }, + "identifierName": "static" + }, + "name": "static" + }, + "kind": "get", + "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/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/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)" +} 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/.335/expected.json b/test/fixtures/es2015/uncategorised/167/expected.json similarity index 56% rename from test/fixtures/es2015/uncategorised/.335/expected.json rename to test/fixtures/es2015/uncategorised/167/expected.json index 5e726736c7..83e3c57d2c 100644 --- a/test/fixtures/es2015/uncategorised/.335/expected.json +++ b/test/fixtures/es2015/uncategorised/167/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 23, + "end": 25, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 23 + "column": 25 } }, "program": { "type": "Program", "start": 0, - "end": 23, + "end": 25, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 25 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "FunctionDeclaration", "start": 0, - "end": 23, + "end": 25, "loc": { "start": { "line": 1, @@ -39,114 +39,116 @@ }, "end": { "line": 1, - "column": 23 + "column": 25 } }, "id": { "type": "Identifier", - "start": 10, - "end": 11, + "start": 9, + "end": 10, "loc": { "start": { "line": 1, - "column": 10 + "column": 9 }, "end": { "line": 1, - "column": 11 - } + "column": 10 + }, + "identifierName": "x" }, - "name": "y" + "name": "x" }, - "generator": true, + "generator": false, "expression": false, + "async": false, "params": [ { - "type": "ObjectPattern", - "start": 12, - "end": 19, + "type": "RestElement", + "start": 11, + "end": 22, "loc": { "start": { "line": 1, - "column": 12 + "column": 11 }, "end": { "line": 1, - "column": 19 + "column": 22 } }, - "properties": [ - { - "type": "Property", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } + "argument": { + "type": "ArrayPattern", + "start": 14, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 14 }, - "method": false, - "shorthand": true, - "computed": false, - "key": { + "end": { + "line": 1, + "column": 22 + } + }, + "elements": [ + { "type": "Identifier", - "start": 13, - "end": 18, + "start": 16, + "end": 17, "loc": { "start": { "line": 1, - "column": 13 + "column": 16 }, "end": { "line": 1, - "column": 18 - } + "column": 17 + }, + "identifierName": "a" }, - "name": "yield" + "name": "a" }, - "kind": "init", - "value": { + { "type": "Identifier", - "start": 13, - "end": 18, + "start": 19, + "end": 20, "loc": { "start": { "line": 1, - "column": 13 + "column": 19 }, "end": { "line": 1, - "column": 18 - } + "column": 20 + }, + "identifierName": "b" }, - "name": "yield" + "name": "b" } - } - ] + ] + } } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, + "start": 23, + "end": 25, "loc": { "start": { "line": 1, - "column": 21 + "column": 23 }, "end": { "line": 1, - "column": 23 + "column": 25 } }, - "body": [] + "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/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/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/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/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/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/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/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/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json b/test/fixtures/es2015/uncategorised/181/expected.json similarity index 54% rename from test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json rename to test/fixtures/es2015/uncategorised/181/expected.json index e99f09b954..abd0b99c56 100644 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-rest/expected.json +++ b/test/fixtures/es2015/uncategorised/181/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 27, + "end": 17, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 27 + "column": 17 } }, "program": { "type": "Program", "start": 0, - "end": 27, + "end": 17, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 27 + "column": 17 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 27, + "end": 17, "loc": { "start": { "line": 1, @@ -39,94 +39,115 @@ }, "end": { "line": 1, - "column": 27 + "column": 17 } }, "expression": { - "type": "FunctionExpression", - "start": 1, - "end": 26, + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, "loc": { "start": { "line": 1, - "column": 1 + "column": 0 }, "end": { "line": 1, - "column": 26 + "column": 17 } }, "id": null, - "generator": true, + "generator": false, "expression": false, + "async": false, "params": [ { "type": "Identifier", - "start": 12, - "end": 13, + "start": 1, + "end": 2, "loc": { "start": { "line": 1, - "column": 12 + "column": 1 }, "end": { "line": 1, - "column": 13 - } + "column": 2 + }, + "identifierName": "a" }, - "name": "x" + "name": "a" }, { "type": "RestElement", - "start": 15, - "end": 23, + "start": 4, + "end": 10, "loc": { "start": { "line": 1, - "column": 15 + "column": 4 }, "end": { "line": 1, - "column": 23 + "column": 10 } }, "argument": { - "type": "Identifier", - "start": 18, - "end": 23, + "type": "ArrayPattern", + "start": 7, + "end": 10, "loc": { "start": { "line": 1, - "column": 18 + "column": 7 }, "end": { "line": 1, - "column": 23 + "column": 10 } }, - "name": "yield" + "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": 24, - "end": 26, + "start": 15, + "end": 17, "loc": { "start": { "line": 1, - "column": 24 + "column": 15 }, "end": { "line": 1, - "column": 26 + "column": 17 } }, - "body": [] - }, - "parenthesizedExpression": true + "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/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/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json b/test/fixtures/es2015/uncategorised/279/expected.json similarity index 59% rename from test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json rename to test/fixtures/es2015/uncategorised/279/expected.json index 4b57db559b..e2a39dc8b2 100644 --- a/test/fixtures/esprima/es2015-generator/.generator-parameter-binding-property-reserved/expected.json +++ b/test/fixtures/es2015/uncategorised/279/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "program": { "type": "Program", "start": 0, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -23,15 +23,15 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "sourceType": "script", "body": [ { - "type": "ExpressionStatement", + "type": "FunctionDeclaration", "start": 0, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -39,50 +39,67 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, - "expression": { - "type": "FunctionExpression", - "start": 1, - "end": 22, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, "loc": { "start": { "line": 1, - "column": 1 + "column": 9 }, "end": { "line": 1, - "column": 22 - } + "column": 10 + }, + "identifierName": "x" }, - "id": null, - "generator": true, - "expression": false, - "params": [ - { + "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": 11, - "end": 18, + "start": 14, + "end": 19, "loc": { "start": { "line": 1, - "column": 11 + "column": 14 }, "end": { "line": 1, - "column": 18 + "column": 19 } }, "properties": [ { - "type": "Property", - "start": 12, + "type": "ObjectProperty", + "start": 16, "end": 17, "loc": { "start": { "line": 1, - "column": 12 + "column": 16 }, "end": { "line": 1, @@ -94,60 +111,65 @@ "computed": false, "key": { "type": "Identifier", - "start": 12, + "start": 16, "end": 17, "loc": { "start": { "line": 1, - "column": 12 + "column": 16 }, "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, - "name": "yield" + "name": "a" }, - "kind": "init", "value": { "type": "Identifier", - "start": 12, + "start": 16, "end": 17, "loc": { "start": { "line": 1, - "column": 12 + "column": 16 }, "end": { "line": 1, "column": 17 - } + }, + "identifierName": "a" }, - "name": "yield" + "name": "a" + }, + "extra": { + "shorthand": true } } ] } - ], - "body": { - "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 }, - "body": [] + "end": { + "line": 1, + "column": 22 + } }, - "parenthesizedExpression": true + "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/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/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/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/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/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/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/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/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/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/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/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 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/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" +} 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/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_0003/options.lightscript.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/options.lightscript.json index 5a91ab8f84..8f8b27f3a3 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/options.lightscript.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:6)" + "throws": "var is a reserved word (1:2)" } \ No newline at end of file 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_0013/options.lightscript.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/options.lightscript.json index 930a14478b..d641239d26 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/options.lightscript.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:8)" + "throws": "throw is a reserved word (1:2)" } \ 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_0014/options.lightscript.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/options.lightscript.json index 930a14478b..d641239d26 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/options.lightscript.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:8)" + "throws": "throw is a reserved word (1:2)" } \ No newline at end of file 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/automatic-semicolon-insertion/migrated_0015/options.lightscript.json b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/options.lightscript.json index 930a14478b..d641239d26 100644 --- a/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/options.lightscript.json +++ b/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:8)" + "throws": "throw is a reserved word (1:2)" } \ No newline at end of file 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_0001/options.lightscript.json b/test/fixtures/esprima/declaration-const/migrated_0001/options.lightscript.json index 930a14478b..760fb20e28 100644 --- a/test/fixtures/esprima/declaration-const/migrated_0001/options.lightscript.json +++ b/test/fixtures/esprima/declaration-const/migrated_0001/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:8)" + "throws": "const is a reserved word (1:2)" } \ No newline at end of file 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-const/migrated_0002/options.lightscript.json b/test/fixtures/esprima/declaration-const/migrated_0002/options.lightscript.json index 930a14478b..760fb20e28 100644 --- a/test/fixtures/esprima/declaration-const/migrated_0002/options.lightscript.json +++ b/test/fixtures/esprima/declaration-const/migrated_0002/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:8)" + "throws": "const is a reserved word (1:2)" } \ No newline at end of file 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_0001/options.lightscript.json b/test/fixtures/esprima/declaration-let/migrated_0001/options.lightscript.json index 5a91ab8f84..44d7775f2c 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0001/options.lightscript.json +++ b/test/fixtures/esprima/declaration-let/migrated_0001/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:6)" + "throws": "let is a reserved word (1:2)" } \ 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_0002/options.lightscript.json b/test/fixtures/esprima/declaration-let/migrated_0002/options.lightscript.json index 5a91ab8f84..44d7775f2c 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0002/options.lightscript.json +++ b/test/fixtures/esprima/declaration-let/migrated_0002/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:6)" + "throws": "let is a reserved word (1:2)" } \ No newline at end of file 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/declaration-let/migrated_0003/options.lightscript.json b/test/fixtures/esprima/declaration-let/migrated_0003/options.lightscript.json index 5a91ab8f84..44d7775f2c 100644 --- a/test/fixtures/esprima/declaration-let/migrated_0003/options.lightscript.json +++ b/test/fixtures/esprima/declaration-let/migrated_0003/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:6)" + "throws": "let is a reserved word (1:2)" } \ No newline at end of file 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/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/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-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 32de26d7ac..f068e87b71 100644 --- a/test/fixtures/esprima/es2015-for-of/for-of/expected.json +++ b/test/fixtures/esprima/es2015-for-of/for-of/expected.json @@ -42,6 +42,7 @@ "column": 13 } }, + "await": false, "left": { "type": "Identifier", "start": 5, @@ -54,7 +55,8 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "p" }, "name": "p" }, @@ -70,7 +72,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "q" }, "name": "q" }, @@ -90,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-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_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/.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/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/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-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/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/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/.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/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/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/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/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/es2015-array-binding-pattern/.invalid-elision-after-rest/expected.json b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/expected.json similarity index 56% rename from test/fixtures/esprima/es2015-array-binding-pattern/.invalid-elision-after-rest/expected.json rename to test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/expected.json index aa98014263..4bdc1344d7 100644 --- a/test/fixtures/esprima/es2015-array-binding-pattern/.invalid-elision-after-rest/expected.json +++ b/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 15, + "end": 16, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 15 + "column": 16 } }, "program": { "type": "Program", "start": 0, - "end": 15, + "end": 16, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 15 + "column": 16 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 15, + "end": 16, "loc": { "start": { "line": 1, @@ -39,13 +39,13 @@ }, "end": { "line": 1, - "column": 15 + "column": 16 } }, "expression": { "type": "ArrowFunctionExpression", "start": 0, - "end": 14, + "end": 16, "loc": { "start": { "line": 1, @@ -53,98 +53,101 @@ }, "end": { "line": 1, - "column": 14 + "column": 16 } }, "id": null, "generator": false, "expression": true, + "async": false, "params": [ { - "type": "ArrayPattern", + "type": "Identifier", "start": 1, - "end": 10, + "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 } }, - "elements": [ - { - "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } + "argument": { + "type": "ArrayPattern", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 }, - "name": "a" + "end": { + "line": 1, + "column": 10 + } }, - { - "type": "RestElement", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "argument": { + "elements": [ + { "type": "Identifier", - "start": 7, - "end": 8, + "start": 8, + "end": 9, "loc": { "start": { "line": 1, - "column": 7 + "column": 8 }, "end": { "line": 1, - "column": 8 - } + "column": 9 + }, + "identifierName": "b" }, "name": "b" } - } - ] + ] + } } ], "body": { - "type": "Literal", - "start": 13, - "end": 14, + "type": "Identifier", + "start": 15, + "end": 16, "loc": { "start": { "line": 1, - "column": 13 + "column": 15 }, "end": { "line": 1, - "column": 14 - } + "column": 16 + }, + "identifierName": "c" }, - "value": 0, - "rawValue": 0, - "raw": "0" + "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/es2015-yield/.invalid-yield-generator-rest/expected.json b/test/fixtures/esprima/rest-parameter/function-declaration/expected.json similarity index 57% rename from test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json rename to test/fixtures/esprima/rest-parameter/function-declaration/expected.json index eb042938fb..07716be5ae 100644 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-rest/expected.json +++ b/test/fixtures/esprima/rest-parameter/function-declaration/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 32, + "end": 22, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 32 + "column": 22 } }, "program": { "type": "Program", "start": 0, - "end": 32, + "end": 22, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 32 + "column": 22 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "FunctionDeclaration", "start": 0, - "end": 32, + "end": 22, "loc": { "start": { "line": 1, @@ -39,125 +39,99 @@ }, "end": { "line": 1, - "column": 32 + "column": 22 } }, "id": { "type": "Identifier", - "start": 10, - "end": 11, + "start": 9, + "end": 10, "loc": { "start": { "line": 1, - "column": 10 + "column": 9 }, "end": { "line": 1, - "column": 11 - } + "column": 10 + }, + "identifierName": "f" }, - "name": "g" + "name": "f" }, - "generator": true, + "generator": false, "expression": false, + "async": 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, + "start": 11, + "end": 12, "loc": { "start": { "line": 1, - "column": 15 + "column": 11 }, "end": { "line": 1, - "column": 16 - } - }, - "name": "b" - }, - { - "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 + "column": 12 }, - "end": { - "line": 1, - "column": 19 - } + "identifierName": "a" }, - "name": "c" + "name": "a" }, { "type": "RestElement", - "start": 21, - "end": 29, + "start": 14, + "end": 18, "loc": { "start": { "line": 1, - "column": 21 + "column": 14 }, "end": { "line": 1, - "column": 29 + "column": 18 } }, "argument": { "type": "Identifier", - "start": 24, - "end": 29, + "start": 17, + "end": 18, "loc": { "start": { "line": 1, - "column": 24 + "column": 17 }, "end": { "line": 1, - "column": 29 - } + "column": 18 + }, + "identifierName": "b" }, - "name": "yield" + "name": "b" } } ], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, + "start": 20, + "end": 22, "loc": { "start": { "line": 1, - "column": 30 + "column": 20 }, "end": { "line": 1, - "column": 32 + "column": 22 } }, - "body": [] + "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/flow/regression/.arrow-function-parens-with-return-type/expected.json b/test/fixtures/esprima/rest-parameter/function-expression/expected.lightscript.json similarity index 56% rename from test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json rename to test/fixtures/esprima/rest-parameter/function-expression/expected.lightscript.json index 4fba0bba88..95432b91d8 100644 --- a/test/fixtures/flow/regression/.arrow-function-parens-with-return-type/expected.json +++ b/test/fixtures/esprima/rest-parameter/function-expression/expected.lightscript.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 32, + "end": 24, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 32 + "column": 24 } }, "program": { "type": "Program", "start": 0, - "end": 32, + "end": 24, "loc": { "start": { "line": 1, @@ -23,15 +23,15 @@ }, "end": { "line": 1, - "column": 32 + "column": 24 } }, - "sourceType": "module", + "sourceType": "script", "body": [ { "type": "VariableDeclaration", "start": 0, - "end": 32, + "end": 24, "loc": { "start": { "line": 1, @@ -39,52 +39,57 @@ }, "end": { "line": 1, - "column": 32 + "column": 24 } }, + "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 31, + "start": 0, + "end": 24, "loc": { "start": { "line": 1, - "column": 4 + "column": 0 }, "end": { "line": 1, - "column": 31 + "column": 24 } }, "id": { "type": "Identifier", - "start": 4, - "end": 7, + "start": 0, + "end": 1, "loc": { "start": { "line": 1, - "column": 4 + "column": 0 }, "end": { "line": 1, - "column": 7 - } + "column": 1 + }, + "identifierName": "f" }, - "name": "foo" + "name": "f" }, "init": { - "type": "ArrowFunctionExpression", - "start": 10, - "end": 31, + "type": "FunctionExpression", + "start": 4, + "end": 24, "loc": { "start": { "line": 1, - "column": 10 + "column": 4 }, "end": { "line": 1, - "column": 31 + "column": 24 } }, "id": null, @@ -94,73 +99,79 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 15, + "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": 12 + "column": 16 }, "end": { "line": 1, - "column": 15 + "column": 20 } }, - "name": "foo", - "parenthesizedExpression": true + "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": 29, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "body": [] - }, - "returnType": { - "type": "TypeAnnotation", - "start": 17, - "end": 25, + "start": 22, + "end": 24, "loc": { "start": { "line": 1, - "column": 17 + "column": 22 }, "end": { "line": 1, - "column": 25 + "column": 24 } }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } + "body": [], + "directives": [], + "extra": { + "curly": true } } } } - ], - "kind": "var" + ] } - ] + ], + "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/es2015/uncategorised/.191/expected.json b/test/fixtures/esprima/rest-parameter/invalid-setter-rest/expected.lightscript.json similarity index 55% rename from test/fixtures/es2015/uncategorised/.191/expected.json rename to test/fixtures/esprima/rest-parameter/invalid-setter-rest/expected.lightscript.json index 2b36873e36..31f4787099 100644 --- a/test/fixtures/es2015/uncategorised/.191/expected.json +++ b/test/fixtures/esprima/rest-parameter/invalid-setter-rest/expected.lightscript.json @@ -42,15 +42,19 @@ "column": 22 } }, + "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", - "start": 4, + "start": 0, "end": 22, "loc": { "start": { "line": 1, - "column": 4 + "column": 0 }, "end": { "line": 1, @@ -58,9 +62,26 @@ } }, "id": { - "type": "ArrayPattern", + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ObjectExpression", "start": 4, - "end": 18, + "end": 22, "loc": { "start": { "line": 1, @@ -68,72 +89,65 @@ }, "end": { "line": 1, - "column": 18 + "column": 22 } }, - "elements": [ + "properties": [ { - "type": "Identifier", - "start": 5, - "end": 6, + "type": "ObjectMethod", + "start": 6, + "end": 20, "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 + "column": 20 } }, - "argument": { - "type": "ArrayPattern", - "start": 11, - "end": 17, + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 11, "loc": { "start": { "line": 1, - "column": 11 + "column": 10 }, "end": { "line": 1, - "column": 17 - } + "column": 11 + }, + "identifierName": "f" }, - "elements": [ - { - "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } + "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 }, - "name": "b" + "end": { + "line": 1, + "column": 16 + } }, - { + "argument": { "type": "Identifier", "start": 15, "end": 16, @@ -145,36 +159,40 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "y" }, - "name": "c" + "name": "y" } - ] + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [], + "extra": { + "curly": true + } } } ] - }, - "init": { - "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "name": "d" } } - ], - "kind": "var" + ] } - ] - }, - "comments": [] + ], + "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-method/expected.lightscript.json b/test/fixtures/esprima/rest-parameter/object-method/expected.lightscript.json new file mode 100644 index 0000000000..797e760035 --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/object-method/expected.lightscript.json @@ -0,0 +1,229 @@ +{ + "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 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "o" + }, + "name": "o" + }, + "init": { + "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": [], + "extra": { + "curly": true + } + } + } + } + ] + } + } + ] + } + ], + "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/object-shorthand-method/expected.lightscript.json b/test/fixtures/esprima/rest-parameter/object-shorthand-method/expected.lightscript.json new file mode 100644 index 0000000000..01ffe59d6f --- /dev/null +++ b/test/fixtures/esprima/rest-parameter/object-shorthand-method/expected.lightscript.json @@ -0,0 +1,198 @@ +{ + "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 + } + }, + "kind": "const", + "extra": { + "implicit": true + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "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": [], + "extra": { + "curly": true + } + } + } + ] + } + } + ] + } + ], + "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/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/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_0003/options.lightscript.json b/test/fixtures/esprima/statement-iteration/migrated_0003/options.lightscript.json index 2d4f18af3e..4f962dbf55 100644 --- a/test/fixtures/esprima/statement-iteration/migrated_0003/options.lightscript.json +++ b/test/fixtures/esprima/statement-iteration/migrated_0003/options.lightscript.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected , (1:5)" -} + "throws": "do is a reserved word (1:2)" +} \ No newline at end of file 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/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 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/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..ea451fd3cb --- /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, + "computed": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "kind": "method", + "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/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 1551481f51..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" }, @@ -78,7 +79,7 @@ }, "body": [ { - "type": "ForAwaitStatement", + "type": "ForOfStatement", "start": 23, "end": 46, "loc": { @@ -91,6 +92,7 @@ "column": 25 } }, + "await": true, "left": { "type": "VariableDeclaration", "start": 34, @@ -132,7 +134,8 @@ "end": { "line": 2, "column": 18 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -153,7 +156,8 @@ "end": { "line": 2, "column": 23 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -180,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-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 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/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/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..e029628a70 --- /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, + "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" + }, + "kind": "get", + "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, + "computed": false, + "key": { + "type": "Identifier", + "start": 366, + "end": 372, + "loc": { + "start": { + "line": 48, + "column": 2 + }, + "end": { + "line": 48, + "column": 8 + }, + "identifierName": "static" + }, + "name": "static" + }, + "kind": "get", + "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/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)" +} 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/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..6933de60e7 --- /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 + } + }, + "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" + } + } + ], + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "body": [] + } + } + } + ], + "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/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/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" +} 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/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/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json b/test/fixtures/experimental/export-extensions/ns-default/expected.json similarity index 57% rename from test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json rename to test/fixtures/experimental/export-extensions/ns-default/expected.json index df826e036e..38c5f40bd5 100644 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-parameter/expected.json +++ b/test/fixtures/experimental/export-extensions/ns-default/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 21, + "end": 31, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 21 + "column": 31 } }, "program": { "type": "Program", "start": 0, - "end": 21, + "end": 31, "loc": { "start": { "line": 1, @@ -23,15 +23,15 @@ }, "end": { "line": 1, - "column": 21 + "column": 31 } }, - "sourceType": "script", + "sourceType": "module", "body": [ { - "type": "ExpressionStatement", + "type": "ExportNamedDeclaration", "start": 0, - "end": 21, + "end": 31, "loc": { "start": { "line": 1, @@ -39,31 +39,28 @@ }, "end": { "line": 1, - "column": 21 + "column": 31 } }, - "expression": { - "type": "FunctionExpression", - "start": 1, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 1 + "specifiers": [ + { + "type": "ExportNamespaceSpecifier", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } }, - "end": { - "line": 1, - "column": 20 - } - }, - "id": null, - "generator": true, - "expression": false, - "params": [ - { + "exported": { "type": "Identifier", "start": 12, - "end": 17, + "end": 19, "loc": { "start": { "line": 1, @@ -71,31 +68,36 @@ }, "end": { "line": 1, - "column": 17 - } + "column": 19 + }, + "identifierName": "default" }, - "name": "yield" + "name": "default" } - ], - "body": { - "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } + } + ], + "source": { + "type": "StringLiteral", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 }, - "body": [] + "end": { + "line": 1, + "column": 30 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" }, - "parenthesizedExpression": true + "value": "foo" } } - ] + ], + "directives": [] } } \ No newline at end of file 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 5ee0540170..5a26deddd0 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": { @@ -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" } diff --git a/test/fixtures/experimental/object-rest-spread/16/expected.json b/test/fixtures/experimental/object-rest-spread/16/expected.json index 6f6be6d836..cd68bed7a3 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": { diff --git a/test/fixtures/experimental/object-rest-spread/17/expected.json b/test/fixtures/experimental/object-rest-spread/17/expected.json index 0c15cfbe9c..c6d9695d8b 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": { diff --git a/test/fixtures/experimental/object-rest-spread/2/expected.json b/test/fixtures/experimental/object-rest-spread/2/expected.json index f017a9cc8e..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,13 +118,17 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } }, { - "type": "RestProperty", + "type": "RestElement", "start": 8, "end": 12, "loc": { @@ -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" } diff --git a/test/fixtures/experimental/object-rest-spread/3/expected.json b/test/fixtures/experimental/object-rest-spread/3/expected.json index 64c2046836..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,13 +122,17 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } }, { - "type": "RestProperty", + "type": "RestElement", "start": 14, "end": 18, "loc": { @@ -151,7 +157,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "y" }, "name": "y" } @@ -177,7 +184,8 @@ "directives": [] }, "extra": { - "parenthesized": true + "parenthesized": true, + "parenStart": 0 } } } diff --git a/test/fixtures/experimental/object-rest-spread/4/expected.json b/test/fixtures/experimental/object-rest-spread/4/expected.json index 0a777c2a2f..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" }, @@ -89,7 +90,7 @@ }, "properties": [ { - "type": "SpreadProperty", + "type": "SpreadElement", "start": 9, "end": 13, "loc": { @@ -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 13c6c8dc0c..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,13 +135,17 @@ "end": { "line": 1, "column": 6 - } + }, + "identifierName": "x" }, "name": "x" + }, + "extra": { + "shorthand": true } }, { - "type": "SpreadProperty", + "type": "SpreadElement", "start": 8, "end": 12, "loc": { @@ -164,7 +170,8 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "y" }, "name": "y" } diff --git a/test/fixtures/experimental/object-rest-spread/5/expected.lightscript.json b/test/fixtures/experimental/object-rest-spread/5/expected.lightscript.json index f7c8bbe8d6..9091d2ca0e 100644 --- a/test/fixtures/experimental/object-rest-spread/5/expected.lightscript.json +++ b/test/fixtures/experimental/object-rest-spread/5/expected.lightscript.json @@ -146,7 +146,7 @@ } }, { - "type": "SpreadProperty", + "type": "SpreadElement", "start": 8, "end": 12, "loc": { @@ -185,4 +185,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..0584ebbbe7 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": { 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)" +} 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/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json similarity index 51% rename from test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json rename to test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json index 9f91e65aeb..6422cab83c 100644 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-strict-array-pattern/expected.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 27, + "end": 15, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 27 + "column": 15 } }, "program": { "type": "Program", "start": 0, - "end": 27, + "end": 15, "loc": { "start": { "line": 1, @@ -23,128 +23,97 @@ }, "end": { "line": 1, - "column": 27 + "column": 15 } }, "sourceType": "script", "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 27, + "start": 0, + "end": 15, "loc": { "start": { "line": 1, - "column": 14 + "column": 0 }, "end": { "line": 1, - "column": 27 + "column": 15 } }, "expression": { - "type": "AssignmentExpression", - "start": 15, - "end": 26, + "type": "TaggedTemplateExpression", + "start": 0, + "end": 15, "loc": { "start": { "line": 1, - "column": 15 + "column": 0 }, "end": { "line": 1, - "column": 26 + "column": 15 } }, - "operator": "=", - "left": { - "type": "ArrayPattern", - "start": 15, - "end": 22, + "tag": { + "type": "Identifier", + "start": 0, + "end": 9, "loc": { "start": { "line": 1, - "column": 15 + "column": 0 }, "end": { "line": 1, - "column": 22 + "column": 9 + }, + "identifierName": "sampleTag" + }, + "name": "sampleTag" + }, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 } }, - "elements": [ + "expressions": [], + "quasis": [ { - "type": "Identifier", - "start": 16, - "end": 21, + "type": "TemplateElement", + "start": 10, + "end": 14, "loc": { "start": { "line": 1, - "column": 16 + "column": 10 }, "end": { "line": 1, - "column": 21 + "column": 14 } }, - "name": "yield" + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": true } ] - }, - "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" - } - } - ] + "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/es2015/uncategorised/336/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json similarity index 52% rename from test/fixtures/es2015/uncategorised/336/expected.json rename to test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json index 9822daf8c2..bf13103e1f 100644 --- a/test/fixtures/es2015/uncategorised/336/expected.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 10, + "end": 13, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 10 + "column": 13 } }, "program": { "type": "Program", "start": 0, - "end": 10, + "end": 13, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 10 + "column": 13 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 10, + "end": 13, "loc": { "start": { "line": 1, @@ -39,13 +39,13 @@ }, "end": { "line": 1, - "column": 10 + "column": 13 } }, "expression": { - "type": "MetaProperty", + "type": "TaggedTemplateExpression", "start": 0, - "end": 10, + "end": 13, "loc": { "start": { "line": 1, @@ -53,13 +53,13 @@ }, "end": { "line": 1, - "column": 10 + "column": 13 } }, - "meta": { + "tag": { "type": "Identifier", "start": 0, - "end": 3, + "end": 9, "loc": { "start": { "line": 1, @@ -67,29 +67,53 @@ }, "end": { "line": 1, - "column": 3 - } + "column": 9 + }, + "identifierName": "sampleTag" }, - "name": "new" + "name": "sampleTag" }, - "property": { - "type": "Identifier", - "start": 4, - "end": 10, + "quasi": { + "type": "TemplateLiteral", + "start": 9, + "end": 13, "loc": { "start": { "line": 1, - "column": 4 + "column": 9 }, "end": { "line": 1, - "column": 10 + "column": 13 } }, - "name": "target" + "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/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json similarity index 52% rename from test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json rename to test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json index 608a26d547..4d954dc2d3 100644 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-expression-name/expected.json +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 20, + "end": 19, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 20 + "column": 19 } }, "program": { "type": "Program", "start": 0, - "end": 20, + "end": 19, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 20 + "column": 19 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 20, + "end": 19, "loc": { "start": { "line": 1, @@ -39,61 +39,81 @@ }, "end": { "line": 1, - "column": 20 + "column": 19 } }, "expression": { - "type": "FunctionExpression", - "start": 1, + "type": "TaggedTemplateExpression", + "start": 0, "end": 19, "loc": { "start": { "line": 1, - "column": 1 + "column": 0 }, "end": { "line": 1, "column": 19 } }, - "id": { + "tag": { "type": "Identifier", - "start": 10, - "end": 15, + "start": 0, + "end": 9, "loc": { "start": { "line": 1, - "column": 10 + "column": 0 }, "end": { "line": 1, - "column": 15 - } + "column": 9 + }, + "identifierName": "sampleTag" }, - "name": "yield" + "name": "sampleTag" }, - "generator": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 17, + "quasi": { + "type": "TemplateLiteral", + "start": 9, "end": 19, "loc": { "start": { "line": 1, - "column": 17 + "column": 9 }, "end": { "line": 1, "column": 19 } }, - "body": [] - }, - "parenthesizedExpression": true + "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..0967ef424b --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json @@ -0,0 +1 @@ +{} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..27524e2b1f --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:10)" +} 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..fd4da953a4 --- /dev/null +++ b/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} 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..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, 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..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, 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..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, @@ -164,7 +165,7 @@ ], "rest": null, "returnType": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 24, "end": 27, "loc": { @@ -177,11 +178,11 @@ "column": 27 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "123" - } + }, + "value": 123 }, "typeParameters": null } 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..70c0c695b0 100644 --- a/test/fixtures/flow/anonymous-function-types/good_01/expected.json +++ b/test/fixtures/flow/anonymous-function-types/good_01/expected.json @@ -187,7 +187,8 @@ } } } - } + }, + "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 e522809a4c..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, @@ -168,7 +169,7 @@ ], "rest": null, "returnType": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 28, "end": 31, "loc": { @@ -181,11 +182,11 @@ "column": 31 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "123" - } + }, + "value": 123 }, "typeParameters": null } 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..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, 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..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, 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..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, @@ -158,7 +159,7 @@ ], "rest": null, "returnType": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 26, "end": 29, "loc": { @@ -171,11 +172,11 @@ "column": 29 } }, - "value": 123, "extra": { "rawValue": 123, "raw": "123" - } + }, + "value": 123 }, "typeParameters": null } 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..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, @@ -118,7 +119,7 @@ }, "types": [ { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 15, "end": 16, "loc": { @@ -131,14 +132,14 @@ "column": 16 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 19, "end": 20, "loc": { @@ -151,11 +152,11 @@ "column": 20 } }, - "value": 2, "extra": { "rawValue": 2, "raw": "2" - } + }, + "value": 2 } ] } 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..87148b542a 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": { @@ -104,7 +105,7 @@ { "type": "ObjectTypeCallProperty", "start": 10, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -112,9 +113,10 @@ }, "end": { "line": 1, - "column": 21 + "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/3/expected.json b/test/fixtures/flow/call-properties/3/expected.json index cd2eadb7d0..acd2bf6782 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": { @@ -104,7 +105,7 @@ { "type": "ObjectTypeCallProperty", "start": 10, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -112,9 +113,10 @@ }, "end": { "line": 1, - "column": 21 + "column": 20 } }, + "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" }, @@ -250,7 +254,7 @@ { "type": "ObjectTypeProperty", "start": 22, - "end": 32, + "end": 31, "loc": { "start": { "line": 1, @@ -258,7 +262,7 @@ }, "end": { "line": 1, - "column": 32 + "column": 31 } }, "key": { @@ -273,10 +277,13 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "y" }, "name": "y" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 25, @@ -292,11 +299,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -305,7 +313,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..08e9c26694 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": { @@ -104,7 +105,7 @@ { "type": "ObjectTypeCallProperty", "start": 10, - "end": 28, + "end": 27, "loc": { "start": { "line": 1, @@ -112,9 +113,10 @@ }, "end": { "line": 1, - "column": 28 + "column": 27 } }, + "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..74587ef411 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, @@ -78,7 +80,7 @@ { "type": "ObjectTypeCallProperty", "start": 14, - "end": 25, + "end": 24, "loc": { "start": { "line": 1, @@ -86,7 +88,7 @@ }, "end": { "line": 1, - "column": 25 + "column": 24 } }, "static": false, @@ -126,10 +128,11 @@ } ], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file 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 e3d5623c98..eea8e7d6a6 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": { @@ -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/es2015/uncategorised/171/options.json b/test/fixtures/flow/declare-export/invalid-export-arrow/options.json similarity index 100% rename from test/fixtures/es2015/uncategorised/171/options.json rename to test/fixtures/flow/declare-export/invalid-export-arrow/options.json 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 6c62e08565..f209133694 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" }, @@ -73,9 +74,10 @@ } }, "body": [] - } + }, + "kind": "CommonJS" } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file 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 8654fdf948..8e61c95762 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": { @@ -135,9 +137,10 @@ } } ] - } + }, + "kind": "CommonJS" } - ] - }, - "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..71deaaf280 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": { @@ -150,12 +152,14 @@ } } } - } + }, + "predicate": null } ] - } + }, + "kind": "CommonJS" } - ] - }, - "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..d6491c6f37 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, @@ -124,7 +127,7 @@ { "type": "ObjectTypeProperty", "start": 37, - "end": 51, + "end": 50, "loc": { "start": { "line": 1, @@ -132,9 +135,28 @@ }, "end": { "line": 1, - "column": 51 + "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, @@ -168,32 +190,18 @@ } } }, - "key": { - "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - } - }, - "name": "foo" - }, "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } ] - } + }, + "kind": "CommonJS" } - ] - }, - "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..7b1772c283 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" }, @@ -120,7 +121,7 @@ { "type": "ObjectTypeProperty", "start": 45, - "end": 59, + "end": 58, "loc": { "start": { "line": 1, @@ -128,9 +129,28 @@ }, "end": { "line": 1, - "column": 59 + "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, @@ -164,31 +184,17 @@ } } }, - "key": { - "type": "Identifier", - "start": 45, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 48 - } - }, - "name": "foo" - }, "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } } ] - } + }, + "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/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..378c963659 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, @@ -79,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 18, - "end": 39, + "end": 38, "loc": { "start": { "line": 1, @@ -87,9 +89,28 @@ }, "end": { "line": 1, - "column": 39 + "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, @@ -123,23 +144,6 @@ } } }, - "static": true, - "key": { - "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "name": "foo" - }, "optional": false }, { @@ -168,10 +172,13 @@ "end": { "line": 1, "column": 48 - } + }, + "identifierName": "x" }, "name": "x" }, + "static": true, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 51, @@ -187,15 +194,15 @@ } } }, - "optional": false, - "static": true, - "variance": null + "variance": null, + "optional": false } ], - "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..6b3d9f0b04 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,10 +104,13 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "foo" }, "name": "foo" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 27, @@ -122,11 +126,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } }, { @@ -155,7 +160,8 @@ "end": { "line": 2, "column": 19 - } + }, + "identifierName": "I" }, "name": "I" }, @@ -188,7 +194,8 @@ "column": 21 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -236,10 +243,13 @@ "end": { "line": 2, "column": 28 - } + }, + "identifierName": "foo" }, "name": "foo" }, + "static": false, + "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 66, @@ -267,16 +277,18 @@ "end": { "line": 2, "column": 31 - } + }, + "identifierName": "T" }, "name": "T" } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "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/17/expected.json b/test/fixtures/flow/declare-statements/17/expected.json index 292b96e24c..2f4a6dc1cb 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": { @@ -109,6 +109,8 @@ }, "name": "a" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 22, @@ -124,14 +126,13 @@ } } }, - "optional": false, - "static": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", "start": 31, - "end": 48, + "end": 47, "loc": { "start": { "line": 3, @@ -139,7 +140,7 @@ }, "end": { "line": 3, - "column": 18 + "column": 17 } }, "key": { @@ -159,6 +160,8 @@ }, "name": "b" }, + "static": true, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 41, @@ -174,14 +177,13 @@ } } }, - "optional": false, - "static": true, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", "start": 50, - "end": 60, + "end": 59, "loc": { "start": { "line": 4, @@ -189,7 +191,7 @@ }, "end": { "line": 4, - "column": 11 + "column": 10 } }, "key": { @@ -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/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..b85ed89a5b 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": { @@ -105,9 +106,10 @@ } } } - } + }, + "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..3551a556fe 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": { @@ -105,9 +106,10 @@ } } } - } + }, + "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..3670040e1d 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 } ] }, @@ -137,7 +139,8 @@ } } } - } + }, + "predicate": null } ], "directives": [] diff --git a/test/fixtures/flow/declare-statements/6/expected.json b/test/fixtures/flow/declare-statements/6/expected.json index c61da189d6..443d802910 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" }, @@ -200,9 +203,10 @@ } } } - } + }, + "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..babd12a4f5 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, @@ -79,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 29, - "end": 72, + "end": 71, "loc": { "start": { "line": 1, @@ -87,9 +89,28 @@ }, "end": { "line": 1, - "column": 72 + "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, @@ -131,7 +152,8 @@ "end": { "line": 1, "column": 44 - } + }, + "identifierName": "view" }, "name": "view" }, @@ -163,7 +185,8 @@ "end": { "line": 1, "column": 51 - } + }, + "identifierName": "Object" }, "name": "Object" } @@ -195,7 +218,8 @@ "end": { "line": 1, "column": 57 - } + }, + "identifierName": "prop" }, "name": "prop" }, @@ -235,29 +259,14 @@ } } }, - "key": { - "type": "Identifier", - "start": 29, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 39 - } - }, - "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..3bafe9b3ab 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,10 +220,13 @@ "end": { "line": 1, "column": 35 - } + }, + "identifierName": "x" }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 37, @@ -235,11 +242,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } ], 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/def-site-variance/1/expected.json b/test/fixtures/flow/def-site-variance/1/expected.json index ad7acee460..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,8 +88,23 @@ "column": 10 } }, - "variance": "plus", - "name": "T" + "name": "T", + "variance": { + "type": "Variance", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "kind": "plus" + } }, { "type": "TypeParameter", @@ -104,8 +120,23 @@ "column": 13 } }, - "variance": "minus", - "name": "U" + "name": "U", + "variance": { + "type": "Variance", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "kind": "minus" + } } ] }, @@ -153,7 +184,8 @@ "end": { "line": 2, "column": 10 - } + }, + "identifierName": "f" }, "name": "f" }, @@ -189,8 +221,23 @@ "column": 13 } }, - "variance": "plus", - "name": "T" + "name": "T", + "variance": { + "type": "Variance", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "kind": "plus" + } }, { "type": "TypeParameter", @@ -206,8 +253,23 @@ "column": 16 } }, - "variance": "minus", - "name": "U" + "name": "U", + "variance": { + "type": "Variance", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "kind": "minus" + } } ] }, @@ -256,7 +318,8 @@ "end": { "line": 3, "column": 6 - } + }, + "identifierName": "T" }, "name": "T" }, @@ -289,8 +352,23 @@ "column": 9 } }, - "variance": "plus", - "name": "T" + "name": "T", + "variance": { + "type": "Variance", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "kind": "plus" + } }, { "type": "TypeParameter", @@ -306,8 +384,23 @@ "column": 12 } }, - "variance": "minus", - "name": "U" + "name": "U", + "variance": { + "type": "Variance", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "kind": "minus" + } } ] }, @@ -327,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/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..4fb5918fb1 --- /dev/null +++ b/test/fixtures/flow/interfaces-module-and-script/10/expected.json @@ -0,0 +1,241 @@ +{ + "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": 48, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "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": 29, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "key": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "static": false, + "kind": "init", + "value": { + "type": "BooleanTypeAnnotation", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 12 + } + } + }, + "variance": null, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 52, + "end": 69, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "key": { + "type": "Identifier", + "start": 59, + "end": 60, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + }, + "identifierName": "y" + }, + "name": "y" + }, + "static": true, + "kind": "init", + "value": { + "type": "BooleanTypeAnnotation", + "start": 62, + "end": 69, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 19 + } + } + }, + "variance": null, + "optional": false + } + ], + "indexers": [], + "exact": false + } + } + ], + "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..83636e0555 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, @@ -79,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 14, - "end": 32, + "end": 31, "loc": { "start": { "line": 1, @@ -87,7 +89,7 @@ }, "end": { "line": 1, - "column": 32 + "column": 31 } }, "key": { @@ -102,10 +104,13 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "foo" }, "name": "foo" }, + "static": false, + "kind": "init", "value": { "type": "FunctionTypeAnnotation", "start": 19, @@ -139,14 +144,15 @@ }, "typeParameters": null }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "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 23bbe6bc92..da45e73fc6 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, @@ -79,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 48, - "end": 63, + "end": 62, "loc": { "start": { "line": 1, @@ -87,7 +89,7 @@ }, "end": { "line": 1, - "column": 63 + "column": 62 } }, "key": { @@ -102,10 +104,13 @@ "end": { "line": 1, "column": 54 - } + }, + "identifierName": "length" }, "name": "length" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 56, @@ -121,15 +126,15 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [ { "type": "ObjectTypeIndexer", "start": 23, - "end": 47, + "end": 46, "loc": { "start": { "line": 1, @@ -137,9 +142,10 @@ }, "end": { "line": 1, - "column": 47 + "column": 46 } }, + "static": false, "id": { "type": "Identifier", "start": 24, @@ -152,7 +158,8 @@ "end": { "line": 1, "column": 29 - } + }, + "identifierName": "index" }, "name": "index" }, @@ -188,10 +195,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 44d455a56d..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": { @@ -87,7 +88,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 16, "loc": { @@ -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 4cdb637a55..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": { @@ -87,7 +88,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 12, "loc": { @@ -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 9b9a6da608..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": { @@ -87,7 +88,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 10, "loc": { @@ -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 a97406933e..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": { @@ -87,7 +88,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 17, "loc": { @@ -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 25ac6b0013..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": { @@ -87,7 +88,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 13, "loc": { @@ -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 136224babb..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": { @@ -87,7 +88,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 13, "loc": { @@ -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 aaa9ab4cce..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": { @@ -87,7 +88,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 12, "loc": { @@ -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 7c7b41adc3..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": { @@ -87,7 +88,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 12, "loc": { @@ -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 608b0731b2..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": { @@ -87,7 +88,7 @@ } }, "typeAnnotation": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 7, "end": 11, "loc": { @@ -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..010fa630f4 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,15 +107,16 @@ "column": 37 } }, - "value": "div", "extra": { "rawValue": "div", "raw": "\"div\"" - } + }, + "value": "div" } } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 38, @@ -154,7 +158,8 @@ "end": { "line": 1, "column": 54 - } + }, + "identifierName": "HTMLDivElement" }, "name": "HTMLDivElement" } diff --git a/test/fixtures/flow/literal-types/string-single/expected.json b/test/fixtures/flow/literal-types/string-single/expected.json index e168fb2f91..bd14fc10ac 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,15 +107,16 @@ "column": 37 } }, - "value": "div", "extra": { "rawValue": "div", "raw": "'div'" - } + }, + "value": "div" } } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 38, @@ -154,7 +158,8 @@ "end": { "line": 1, "column": 54 - } + }, + "identifierName": "HTMLDivElement" }, "name": "HTMLDivElement" } 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/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..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 } } } @@ -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..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, @@ -253,4 +238,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..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, @@ -267,4 +252,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 0805a80bd3..d0c50d9555 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": { @@ -191,11 +191,11 @@ "column": 40 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 } ] }, @@ -530,7 +530,7 @@ } }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 82, "end": 83, "loc": { @@ -543,11 +543,11 @@ "column": 83 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 } ] }, @@ -591,9 +591,10 @@ } } } - } + }, + "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/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..9e890e3ca3 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 } }, + "predicate": null, + "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 + } + } + } + }, "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..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,55 @@ "column": 42 } }, + "predicate": null, + "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" + } + } + }, "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..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, @@ -136,15 +138,14 @@ "column": 13 } }, - "value": "A", "extra": { "rawValue": "A", "raw": "\"A\"" - } + }, + "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, @@ -211,15 +214,14 @@ "column": 13 } }, - "value": "B", "extra": { "rawValue": "B", "raw": "\"B\"" - } + }, + "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, @@ -597,15 +603,14 @@ "column": 16 } }, - "value": "A", "extra": { "rawValue": "A", "raw": "\"A\"" - } + }, + "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, @@ -672,15 +679,14 @@ "column": 16 } }, - "value": "B", "extra": { "rawValue": "B", "raw": "\"B\"" - } + }, + "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, @@ -852,15 +861,14 @@ "column": 16 } }, - "value": "A", "extra": { "rawValue": "A", "raw": "\"A\"" - } + }, + "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, @@ -927,15 +937,14 @@ "column": 16 } }, - "value": "B", "extra": { "rawValue": "B", "raw": "\"B\"" - } + }, + "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/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..a0e6a89d2c 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": [], + "predicate": null, + "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 + } + }, + "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..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, @@ -111,7 +112,8 @@ "end": { "line": 1, "column": 36 - } + }, + "identifierName": "ReturnType" }, "name": "ReturnType" } @@ -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..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, @@ -128,7 +129,8 @@ "end": { "line": 1, "column": 36 - } + }, + "identifierName": "Array" }, "name": "Array" } @@ -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..fd5baadca1 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" }, @@ -87,6 +88,7 @@ "column": 73 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 65, @@ -128,7 +130,8 @@ "end": { "line": 1, "column": 67 - } + }, + "identifierName": "a" }, "name": "a" } @@ -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..54aad24d12 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": { @@ -134,6 +134,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 14, @@ -149,8 +151,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -183,6 +185,8 @@ }, "name": "y" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 25, @@ -198,8 +202,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -416,7 +420,7 @@ { "type": "ObjectTypeProperty", "start": 68, - "end": 78, + "end": 77, "loc": { "start": { "line": 2, @@ -424,7 +428,7 @@ }, "end": { "line": 2, - "column": 21 + "column": 20 } }, "key": { @@ -444,6 +448,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 71, @@ -459,13 +465,13 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", "start": 79, - "end": 89, + "end": 88, "loc": { "start": { "line": 2, @@ -473,7 +479,7 @@ }, "end": { "line": 2, - "column": 32 + "column": 31 } }, "key": { @@ -493,6 +499,8 @@ }, "name": "y" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 82, @@ -508,8 +516,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -826,7 +834,7 @@ { "type": "ObjectTypeProperty", "start": 145, - "end": 175, + "end": 174, "loc": { "start": { "line": 4, @@ -834,7 +842,7 @@ }, "end": { "line": 4, - "column": 40 + "column": 39 } }, "key": { @@ -854,6 +862,8 @@ }, "name": "a" }, + "static": false, + "kind": "init", "value": { "type": "ObjectTypeAnnotation", "start": 148, @@ -873,7 +883,7 @@ { "type": "ObjectTypeProperty", "start": 151, - "end": 161, + "end": 160, "loc": { "start": { "line": 4, @@ -881,7 +891,7 @@ }, "end": { "line": 4, - "column": 26 + "column": 25 } }, "key": { @@ -901,6 +911,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 154, @@ -916,8 +928,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -950,6 +962,8 @@ }, "name": "y" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 165, @@ -965,15 +979,15 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], "exact": true }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -1006,6 +1020,8 @@ }, "name": "b" }, + "static": false, + "kind": "init", "value": { "type": "BooleanTypeAnnotation", "start": 179, @@ -1021,8 +1037,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], @@ -1342,7 +1358,7 @@ { "type": "ObjectTypeProperty", "start": 239, - "end": 267, + "end": 266, "loc": { "start": { "line": 5, @@ -1350,7 +1366,7 @@ }, "end": { "line": 5, - "column": 39 + "column": 38 } }, "key": { @@ -1370,6 +1386,8 @@ }, "name": "a" }, + "static": false, + "kind": "init", "value": { "type": "ObjectTypeAnnotation", "start": 242, @@ -1389,7 +1407,7 @@ { "type": "ObjectTypeProperty", "start": 244, - "end": 254, + "end": 253, "loc": { "start": { "line": 5, @@ -1397,7 +1415,7 @@ }, "end": { "line": 5, - "column": 26 + "column": 25 } }, "key": { @@ -1417,6 +1435,8 @@ }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 247, @@ -1432,8 +1452,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -1466,6 +1486,8 @@ }, "name": "y" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 258, @@ -1481,15 +1503,15 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], "exact": false }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -1522,6 +1544,8 @@ }, "name": "b" }, + "static": false, + "kind": "init", "value": { "type": "BooleanTypeAnnotation", "start": 271, @@ -1537,8 +1561,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [], 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 6556914731..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,9 +142,23 @@ "name": "T" } }, - "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" + }, + "optional": false } ], "indexers": [], @@ -152,4 +168,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 8dde23737d..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,9 +142,23 @@ "name": "T" } }, - "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" + }, + "optional": false } ], "indexers": [], @@ -152,4 +168,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 6279284056..5cbe3ec43a 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 @@ -184,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 2ed71ae23e..cdb32af1e6 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 @@ -184,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 3197ff95a7..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", @@ -107,8 +108,22 @@ }, "name": "p" }, - "variance": "plus", - "static": false, + "variance": { + "type": "Variance", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "kind": "plus" + }, "typeAnnotation": { "type": "TypeAnnotation", "start": 11, @@ -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..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", @@ -107,8 +108,22 @@ }, "name": "p" }, - "variance": "minus", - "static": false, + "variance": { + "type": "Variance", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "kind": "minus" + }, "typeAnnotation": { "type": "TypeAnnotation", "start": 11, @@ -165,4 +180,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/flow/type-annotations/12/expected.json b/test/fixtures/flow/type-annotations/12/expected.json index fddf075029..22f2c3c9df 100644 --- a/test/fixtures/flow/type-annotations/12/expected.json +++ b/test/fixtures/flow/type-annotations/12/expected.json @@ -54,13 +54,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, diff --git a/test/fixtures/flow/type-annotations/129/expected.json b/test/fixtures/flow/type-annotations/129/expected.json index e55c90e118..ecffbbf855 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": { @@ -116,14 +116,14 @@ "column": 4 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 15, "end": 16, "loc": { @@ -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..3a78824d22 100644 --- a/test/fixtures/flow/type-annotations/13/expected.json +++ b/test/fixtures/flow/type-annotations/13/expected.json @@ -54,13 +54,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, diff --git a/test/fixtures/flow/type-annotations/130/expected.json b/test/fixtures/flow/type-annotations/130/expected.json index 2a823858a4..15ad52dcb9 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": { @@ -122,14 +122,14 @@ "column": 17 } }, - "value": 1, "extra": { "rawValue": 1, "raw": "1" - } + }, + "value": 1 }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 20, "end": 21, "loc": { @@ -142,11 +142,11 @@ "column": 21 } }, - "value": 2, "extra": { "rawValue": 2, "raw": "2" - } + }, + "value": 2 } ] } @@ -198,7 +198,7 @@ }, "types": [ { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 28, "end": 29, "loc": { @@ -211,14 +211,14 @@ "column": 29 } }, - "value": 3, "extra": { "rawValue": 3, "raw": "3" - } + }, + "value": 3 }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 32, "end": 33, "loc": { @@ -231,17 +231,18 @@ "column": 33 } }, - "value": 4, "extra": { "rawValue": 4, "raw": "4" - } + }, + "value": 4 } ] } } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 34, 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..c7a1a030de --- /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..14027b107e --- /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": 18, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "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..dedc0308d2 --- /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..6ccd7002c9 --- /dev/null +++ b/test/fixtures/flow/type-annotations/136/expected.json @@ -0,0 +1,176 @@ +{ + "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": 17, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 2 + }, + "identifierName": "p" + }, + "name": "p" + }, + "static": false, + "kind": "init", + "value": { + "type": "ObjectTypeAnnotation", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "exact": false + }, + "variance": null, + "optional": false + }, + { + "type": "ObjectTypeSpreadProperty", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "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..01cb0ff54f --- /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..786acad32a --- /dev/null +++ b/test/fixtures/flow/type-annotations/137/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Spread operator cannot 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..77fb2e7812 --- /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..c0368f8f26 --- /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 diff --git a/test/fixtures/flow/type-annotations/14/expected.json b/test/fixtures/flow/type-annotations/14/expected.json index 96fb6480b2..807aa5b5a4 100644 --- a/test/fixtures/flow/type-annotations/14/expected.json +++ b/test/fixtures/flow/type-annotations/14/expected.json @@ -54,13 +54,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -116,7 +119,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "_" }, "name": "_" }, diff --git a/test/fixtures/flow/type-annotations/15/expected.json b/test/fixtures/flow/type-annotations/15/expected.json index 310bd0ca0c..9d52a5cde3 100644 --- a/test/fixtures/flow/type-annotations/15/expected.json +++ b/test/fixtures/flow/type-annotations/15/expected.json @@ -54,13 +54,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -116,7 +119,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "_" }, "name": "_" }, diff --git a/test/fixtures/flow/type-annotations/16/expected.json b/test/fixtures/flow/type-annotations/16/expected.json index 392f618655..51bc95587f 100644 --- a/test/fixtures/flow/type-annotations/16/expected.json +++ b/test/fixtures/flow/type-annotations/16/expected.json @@ -54,13 +54,16 @@ "end": { "line": 1, "column": 12 - } + }, + "identifierName": "foo" }, "name": "foo" }, "generator": false, "expression": false, + "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -91,7 +94,8 @@ }, "callProperties": [], "properties": [], - "indexers": [] + "indexers": [], + "exact": false } }, "body": { 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/20/expected.lightscript.json b/test/fixtures/flow/type-annotations/20/expected.lightscript.json index 9031bdb5ab..c44d8aacf1 100644 --- a/test/fixtures/flow/type-annotations/20/expected.lightscript.json +++ b/test/fixtures/flow/type-annotations/20/expected.lightscript.json @@ -126,7 +126,6 @@ }, "kind": "set", "variance": null, - "variancePos": 7, "id": null, "generator": false, "expression": false, @@ -209,4 +208,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/flow/type-annotations/21/expected.json b/test/fixtures/flow/type-annotations/21/expected.json index d1ddc78e40..c5d4df45b5 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": { @@ -174,6 +178,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 28, diff --git a/test/fixtures/flow/type-annotations/21/expected.lightscript.json b/test/fixtures/flow/type-annotations/21/expected.lightscript.json index a9fb59fcf9..e1c974ab59 100644 --- a/test/fixtures/flow/type-annotations/21/expected.lightscript.json +++ b/test/fixtures/flow/type-annotations/21/expected.lightscript.json @@ -126,7 +126,6 @@ }, "kind": "set", "variance": null, - "variancePos": 7, "id": null, "generator": false, "expression": false, @@ -239,4 +238,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/flow/type-annotations/22/expected.json b/test/fixtures/flow/type-annotations/22/expected.json index 4725285737..3cbd6273d8 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,16 +118,19 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "fooProp" }, "name": "fooProp" }, "kind": "get", + "variance": null, "id": null, "generator": false, "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 16, diff --git a/test/fixtures/flow/type-annotations/22/expected.lightscript.json b/test/fixtures/flow/type-annotations/22/expected.lightscript.json index 1d700bbd52..9b67a8d3d9 100644 --- a/test/fixtures/flow/type-annotations/22/expected.lightscript.json +++ b/test/fixtures/flow/type-annotations/22/expected.lightscript.json @@ -126,7 +126,6 @@ }, "kind": "get", "variance": null, - "variancePos": 7, "id": null, "generator": false, "expression": false, @@ -191,4 +190,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/flow/type-annotations/23/expected.json b/test/fixtures/flow/type-annotations/23/expected.json index 3cb0c90897..05b77ef383 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" } @@ -191,6 +195,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 14, @@ -232,7 +237,8 @@ "end": { "line": 1, "column": 17 - } + }, + "identifierName": "T" }, "name": "T" } @@ -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..ffb6d1e92c 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" } @@ -191,6 +195,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 15, @@ -232,7 +237,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "T" }, "name": "T" } @@ -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..cdf03fcf78 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" } @@ -191,6 +195,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 20, @@ -232,7 +237,8 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "T" }, "name": "T" } @@ -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..9a5cf1d754 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" } @@ -195,6 +198,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 15, @@ -236,7 +240,8 @@ "end": { "line": 1, "column": 18 - } + }, + "identifierName": "T" }, "name": "T" } @@ -288,7 +293,8 @@ "column": 8 } }, - "name": "T" + "name": "T", + "variance": null } ] } diff --git a/test/fixtures/flow/type-annotations/26/expected.lightscript.json b/test/fixtures/flow/type-annotations/26/expected.lightscript.json index db8d072cb6..3461a6c332 100644 --- a/test/fixtures/flow/type-annotations/26/expected.lightscript.json +++ b/test/fixtures/flow/type-annotations/26/expected.lightscript.json @@ -199,6 +199,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 15, @@ -310,4 +311,4 @@ ], "directives": [] } -} \ No newline at end of file +} 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..4dc6a8495b 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": { @@ -159,6 +162,7 @@ } } ], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 36, diff --git a/test/fixtures/flow/type-annotations/29/expected.json b/test/fixtures/flow/type-annotations/29/expected.json index b675422aca..14dda0a969 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,17 +103,18 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "fooProp" }, "name": "fooProp" }, - "static": false, "kind": "get", "id": null, "generator": false, "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 24, 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..2009fe86e1 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,10 +129,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "numVal" }, "name": "numVal" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -147,11 +151,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -160,7 +165,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..20c064ef1a 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": { @@ -105,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -113,7 +114,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "key": { @@ -128,10 +129,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "numVal" }, "name": "numVal" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -147,11 +151,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -160,7 +165,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..8214472aee 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": { @@ -105,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -113,7 +114,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "key": { @@ -128,10 +129,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "numVal" }, "name": "numVal" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -147,8 +151,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], "indexers": [ @@ -166,6 +170,7 @@ "column": 49 } }, + "static": false, "id": { "type": "Identifier", "start": 25, @@ -178,7 +183,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "indexer" }, "name": "indexer" }, @@ -214,7 +220,8 @@ }, "variance": null } - ] + ], + "exact": false } } }, @@ -223,7 +230,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..0a016d2518 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,10 +143,13 @@ "end": { "line": 1, "column": 15 - } + }, + "identifierName": "numVal" }, "name": "numVal" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 17, @@ -161,11 +165,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } } @@ -175,7 +180,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..31e1d58d02 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": { @@ -105,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -113,7 +114,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "key": { @@ -128,10 +129,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "numVal" }, "name": "numVal" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -147,8 +151,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -176,10 +180,13 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "strVal" }, "name": "strVal" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 32, @@ -195,11 +202,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -208,7 +216,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..5c4dbc804f 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,10 +129,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "subObj" }, "name": "subObj" }, + "static": false, + "kind": "init", "value": { "type": "ObjectTypeAnnotation", "start": 16, @@ -174,10 +178,13 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "strVal" }, "name": "strVal" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 25, @@ -193,17 +200,19 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -212,7 +221,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..13365bd73e 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,10 +129,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "subObj" }, "name": "subObj" }, + "static": false, + "kind": "init", "value": { "type": "NullableTypeAnnotation", "start": 16, @@ -188,10 +192,13 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "strVal" }, "name": "strVal" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 26, @@ -207,18 +214,20 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -227,7 +236,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..ff7898371e 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": { @@ -105,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -113,7 +114,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "key": { @@ -128,10 +129,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "param1" }, "name": "param1" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -147,8 +151,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -176,10 +180,13 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "param2" }, "name": "param2" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 32, @@ -195,11 +202,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -208,7 +216,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..fc457a1df3 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": { @@ -105,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 23, + "end": 22, "loc": { "start": { "line": 1, @@ -113,7 +114,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 22 } }, "key": { @@ -128,10 +129,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "param1" }, "name": "param1" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 16, @@ -147,8 +151,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -176,10 +180,13 @@ "end": { "line": 1, "column": 30 - } + }, + "identifierName": "param2" }, "name": "param2" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 33, @@ -195,11 +202,12 @@ } } }, - "optional": true, - "variance": null + "variance": null, + "optional": true } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -208,7 +216,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 11f1b5529a..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": { @@ -106,7 +107,7 @@ { "type": "ObjectTypeIndexer", "start": 9, - "end": 29, + "end": 28, "loc": { "start": { "line": 1, @@ -114,9 +115,10 @@ }, "end": { "line": 1, - "column": 29 + "column": 28 } }, + "static": false, "id": { "type": "Identifier", "start": 10, @@ -129,7 +131,8 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "a" }, "name": "a" }, @@ -162,12 +165,13 @@ "column": 28 } } - } + }, + "variance": null }, { "type": "ObjectTypeIndexer", "start": 30, - "end": 50, + "end": 49, "loc": { "start": { "line": 1, @@ -175,9 +179,10 @@ }, "end": { "line": 1, - "column": 50 + "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..71e3447c35 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": { @@ -116,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, @@ -157,7 +177,8 @@ "end": { "line": 1, "column": 13 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -205,7 +226,8 @@ "end": { "line": 1, "column": 26 - } + }, + "identifierName": "y" }, "name": "y" }, @@ -268,7 +290,8 @@ "end": { "line": 1, "column": 32 - } + }, + "identifierName": "Array" }, "name": "Array" } @@ -291,26 +314,11 @@ } } }, - "key": { - "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "name": "add" - }, "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -319,7 +327,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..07ba5008e4 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": { @@ -105,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 9, - "end": 24, + "end": 23, "loc": { "start": { "line": 1, @@ -113,9 +114,28 @@ }, "end": { "line": 1, - "column": 24 + "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, @@ -157,7 +177,8 @@ "end": { "line": 1, "column": 16 - } + }, + "identifierName": "x" }, "name": "x" }, @@ -189,7 +210,8 @@ "end": { "line": 1, "column": 19 - } + }, + "identifierName": "T" }, "name": "T" } @@ -226,7 +248,8 @@ "column": 13 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -257,32 +280,18 @@ "end": { "line": 1, "column": 23 - } + }, + "identifierName": "T" }, "name": "T" } } }, - "key": { - "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "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..2682c49d27 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 } ] }, @@ -178,6 +182,7 @@ "expression": false, "async": false, "params": [], + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 23, 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..7bcec9cc23 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 } } ], @@ -156,7 +161,7 @@ { "type": "ObjectTypeProperty", "start": 10, - "end": 20, + "end": 19, "loc": { "start": { "line": 1, @@ -164,7 +169,7 @@ }, "end": { "line": 1, - "column": 20 + "column": 19 } }, "key": { @@ -179,10 +184,13 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "x" }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 13, @@ -198,11 +206,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -250,7 +259,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..d67405b5b2 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,10 +184,13 @@ "end": { "line": 1, "column": 11 - } + }, + "identifierName": "x" }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 13, @@ -198,11 +206,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -250,7 +259,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..9317604671 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 } } ], @@ -161,7 +167,7 @@ { "type": "ObjectTypeProperty", "start": 20, - "end": 30, + "end": 29, "loc": { "start": { "line": 1, @@ -169,7 +175,7 @@ }, "end": { "line": 1, - "column": 30 + "column": 29 } }, "key": { @@ -184,10 +190,13 @@ "end": { "line": 1, "column": 21 - } + }, + "identifierName": "x" }, "name": "x" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 23, @@ -203,11 +212,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "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..5d9f3d2448 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" }, @@ -87,6 +88,7 @@ "column": 27 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 12, @@ -120,6 +122,7 @@ "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..68c74a61bf 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 } }, + "predicate": null, + "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 + } + } + } + }, "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..c43076a1e5 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" }, @@ -87,6 +88,7 @@ "column": 28 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 13, @@ -120,6 +122,7 @@ "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..84c65077ec 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 } }, + "predicate": null, + "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 + } + } + } + }, "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..a3fcb6dbeb 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 } }, + "predicate": null, + "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 + } + } + } + }, "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..eac4bddf31 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 } }, + "predicate": null, + "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 + } + } + } + }, "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..0b51971251 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": { @@ -105,7 +106,7 @@ { "type": "ObjectTypeProperty", "start": 8, - "end": 24, + "end": 23, "loc": { "start": { "line": 1, @@ -113,7 +114,7 @@ }, "end": { "line": 1, - "column": 24 + "column": 23 } }, "key": { @@ -128,10 +129,13 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "param1" }, "name": "param1" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 17, @@ -147,13 +151,13 @@ } } }, - "optional": true, - "variance": null + "variance": null, + "optional": true }, { "type": "ObjectTypeProperty", "start": 25, - "end": 40, + "end": 39, "loc": { "start": { "line": 1, @@ -161,7 +165,7 @@ }, "end": { "line": 1, - "column": 40 + "column": 39 } }, "key": { @@ -176,10 +180,13 @@ "end": { "line": 1, "column": 31 - } + }, + "identifierName": "param2" }, "name": "param2" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 33, @@ -195,13 +202,13 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", "start": 41, - "end": 56, + "end": 55, "loc": { "start": { "line": 1, @@ -209,7 +216,7 @@ }, "end": { "line": 1, - "column": 56 + "column": 55 } }, "key": { @@ -224,10 +231,13 @@ "end": { "line": 1, "column": 47 - } + }, + "identifierName": "param3" }, "name": "param3" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 49, @@ -243,11 +253,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -256,7 +267,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 1c35c17698..02ba0fbe88 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 } }, + "predicate": null, + "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" + } + } + }, "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,58 +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": [] + } } 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..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, diff --git a/test/fixtures/flow/type-annotations/builtin/expected.json b/test/fixtures/flow/type-annotations/builtin/expected.json index 8c51c73f05..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": "" } }, { @@ -637,7 +637,7 @@ }, "typeParameters": null, "right": { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 215, "end": 216, "loc": { @@ -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 12bf9c1462..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 @@ -69,7 +69,8 @@ "end": { "line": 1, "column": 9 - } + }, + "identifierName": "f" }, "name": "f", "typeAnnotation": { @@ -87,7 +88,7 @@ } }, "typeAnnotation": { - "type": "ExistentialTypeParam", + "type": "ExistsTypeAnnotation", "start": 8, "end": 9, "loc": { @@ -117,6 +118,7 @@ "column": 38 } }, + "predicate": null, "returnType": { "type": "TypeAnnotation", "start": 27, @@ -132,7 +134,7 @@ } }, "typeAnnotation": { - "type": "ExistentialTypeParam", + "type": "ExistsTypeAnnotation", "start": 30, "end": 31, "loc": { @@ -164,7 +166,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "x" }, "name": "x", "typeAnnotation": { @@ -213,7 +216,7 @@ "value": true }, { - "type": "ExistentialTypeParam", + "type": "ExistsTypeAnnotation", "start": 24, "end": 25, "loc": { @@ -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 d9e6a9657d..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,13 +149,14 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "T" }, "name": "T" } }, { - "type": "ExistentialTypeParam", + "type": "ExistsTypeAnnotation", "start": 26, "end": 27, "loc": { @@ -181,7 +184,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "_Maybe" }, "name": "_Maybe" } 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 21f2b225e8..e3fe56e9dc 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": { @@ -89,14 +89,14 @@ "column": 6 } }, - "value": -1, "extra": { "rawValue": -1, "raw": "-1" - } + }, + "value": -1 }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 52, "end": 53, "loc": { @@ -109,14 +109,14 @@ "column": 5 } }, - "value": 0, "extra": { "rawValue": 0, "raw": "0" - } + }, + "value": 0 }, { - "type": "NumericLiteralTypeAnnotation", + "type": "NumberLiteralTypeAnnotation", "start": 58, "end": 59, "loc": { @@ -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..f835d903ed 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,10 +121,13 @@ "end": { "line": 1, "column": 24 - } + }, + "identifierName": "p" }, "name": "p" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 26, @@ -139,11 +143,12 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -205,7 +210,8 @@ "end": { "line": 2, "column": 20 - } + }, + "identifierName": "bar" }, "name": "bar" }, @@ -238,7 +244,8 @@ "column": 22 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -286,10 +293,13 @@ "end": { "line": 2, "column": 27 - } + }, + "identifierName": "p" }, "name": "p" }, + "static": false, + "kind": "init", "value": { "type": "GenericTypeAnnotation", "start": 65, @@ -317,16 +327,18 @@ "end": { "line": 2, "column": 30 - } + }, + "identifierName": "T" }, "name": "T" } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "indexers": [] + "indexers": [], + "exact": false } } }, @@ -348,4 +360,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-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 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..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 @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 20, - "end": 38, + "end": 37, "loc": { "start": { "line": 2, @@ -89,9 +89,28 @@ }, "end": { "line": 2, - "column": 20 + "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, @@ -137,7 +156,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -157,30 +177,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 41, - "end": 59, + "end": 58, "loc": { "start": { "line": 3, @@ -188,9 +190,28 @@ }, "end": { "line": 3, - "column": 20 + "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, @@ -236,7 +257,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -256,30 +278,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 62, - "end": 79, + "end": 78, "loc": { "start": { "line": 4, @@ -287,9 +291,28 @@ }, "end": { "line": 4, - "column": 19 + "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, @@ -335,7 +358,8 @@ "column": 9 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -355,30 +379,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 82, - "end": 96, + "end": 95, "loc": { "start": { "line": 5, @@ -386,9 +392,28 @@ }, "end": { "line": 5, - "column": 16 + "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, @@ -434,7 +459,8 @@ "column": 6 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -454,30 +480,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 99, - "end": 124, + "end": 123, "loc": { "start": { "line": 6, @@ -485,9 +493,28 @@ }, "end": { "line": 6, - "column": 27 + "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, @@ -533,7 +560,8 @@ "column": 17 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -553,30 +581,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 127, - "end": 152, + "end": 151, "loc": { "start": { "line": 7, @@ -584,9 +594,28 @@ }, "end": { "line": 7, - "column": 27 + "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, @@ -632,7 +661,8 @@ "column": 17 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -652,30 +682,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 155, - "end": 179, + "end": 178, "loc": { "start": { "line": 8, @@ -683,9 +695,28 @@ }, "end": { "line": 8, - "column": 26 + "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, @@ -731,7 +762,8 @@ "column": 16 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -751,30 +783,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 182, - "end": 203, + "end": 202, "loc": { "start": { "line": 9, @@ -782,9 +796,28 @@ }, "end": { "line": 9, - "column": 23 + "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, @@ -830,7 +863,8 @@ "column": 13 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -850,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 7fe3231b43..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 @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 24, - "end": 42, + "end": 41, "loc": { "start": { "line": 2, @@ -89,9 +89,28 @@ }, "end": { "line": 2, - "column": 20 + "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, @@ -137,7 +156,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -157,30 +177,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 45, - "end": 63, + "end": 62, "loc": { "start": { "line": 3, @@ -188,9 +190,28 @@ }, "end": { "line": 3, - "column": 20 + "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, @@ -236,7 +257,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -256,30 +278,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 66, - "end": 83, + "end": 82, "loc": { "start": { "line": 4, @@ -287,9 +291,28 @@ }, "end": { "line": 4, - "column": 19 + "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, @@ -335,7 +358,8 @@ "column": 9 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -355,30 +379,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 86, - "end": 100, + "end": 99, "loc": { "start": { "line": 5, @@ -386,9 +392,28 @@ }, "end": { "line": 5, - "column": 16 + "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, @@ -434,7 +459,8 @@ "column": 6 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -454,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/default/expected.json b/test/fixtures/flow/type-parameter-declaration/default/expected.json index 65e1d32891..56cf6e37d7 100644 --- a/test/fixtures/flow/type-parameter-declaration/default/expected.json +++ b/test/fixtures/flow/type-parameter-declaration/default/expected.json @@ -205,7 +205,7 @@ "name": "T", "variance": null, "default": { - "type": "ExistentialTypeParam", + "type": "ExistsTypeAnnotation", "start": 34, "end": 35, "loc": { diff --git a/test/fixtures/flow/type-parameter-declaration/default/expected.lightscript.json b/test/fixtures/flow/type-parameter-declaration/default/expected.lightscript.json deleted file mode 100644 index 65e1d32891..0000000000 --- a/test/fixtures/flow/type-parameter-declaration/default/expected.lightscript.json +++ /dev/null @@ -1,3329 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 768, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 22, - "column": 20 - } - }, - "program": { - "type": "Program", - "start": 0, - "end": 768, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 22, - "column": 20 - } - }, - "sourceType": "module", - "body": [ - { - "type": "TypeAlias", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "id": { - "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "StringTypeAnnotation", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "T" - }, - "name": "T" - } - } - }, - { - "type": "TypeAlias", - "start": 23, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, - "id": { - "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 12 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "ExistentialTypeParam", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "T" - }, - "name": "T" - } - } - }, - { - "type": "TypeAlias", - "start": 41, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 31 - } - }, - "id": { - "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 47, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 27 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 48, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 26 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 49, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 17 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 51, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 17 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 52, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 17 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 61, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 26 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 31 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 31 - }, - "identifierName": "T" - }, - "name": "T" - } - } - }, - { - "type": "TypeAlias", - "start": 73, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 34 - } - }, - "id": { - "type": "Identifier", - "start": 78, - "end": 79, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 79, - "end": 103, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 30 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 80, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 8 - } - }, - "name": "S", - "variance": null - }, - { - "type": "TypeParameter", - "start": 83, - "end": 102, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 29 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 84, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 20 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 86, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 20 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 87, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 20 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 96, - "end": 102, - "loc": { - "start": { - "line": 4, - "column": 23 - }, - "end": { - "line": 4, - "column": 29 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 106, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 33 - }, - "end": { - "line": 4, - "column": 34 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 106, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 33 - }, - "end": { - "line": 4, - "column": 34 - }, - "identifierName": "T" - }, - "name": "T" - } - } - }, - { - "type": "TypeAlias", - "start": 108, - "end": 151, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 43 - } - }, - "id": { - "type": "Identifier", - "start": 113, - "end": 114, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 114, - "end": 147, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 39 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 115, - "end": 125, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 17 - } - }, - "name": "S", - "variance": null, - "default": { - "type": "NumberTypeAnnotation", - "start": 119, - "end": 125, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 17 - } - } - } - }, - { - "type": "TypeParameter", - "start": 127, - "end": 146, - "loc": { - "start": { - "line": 5, - "column": 19 - }, - "end": { - "line": 5, - "column": 38 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 128, - "end": 137, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 29 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 130, - "end": 137, - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 29 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 131, - "end": 137, - "loc": { - "start": { - "line": 5, - "column": 23 - }, - "end": { - "line": 5, - "column": 29 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 140, - "end": 146, - "loc": { - "start": { - "line": 5, - "column": 32 - }, - "end": { - "line": 5, - "column": 38 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 150, - "end": 151, - "loc": { - "start": { - "line": 5, - "column": 42 - }, - "end": { - "line": 5, - "column": 43 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 150, - "end": 151, - "loc": { - "start": { - "line": 5, - "column": 42 - }, - "end": { - "line": 5, - "column": 43 - }, - "identifierName": "T" - }, - "name": "T" - } - } - }, - { - "type": "ClassDeclaration", - "start": 152, - "end": 174, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 22 - } - }, - "id": { - "type": "Identifier", - "start": 158, - "end": 159, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 7 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 159, - "end": 171, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 19 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 160, - "end": 170, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 18 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "StringTypeAnnotation", - "start": 164, - "end": 170, - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 18 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 172, - "end": 174, - "loc": { - "start": { - "line": 6, - "column": 20 - }, - "end": { - "line": 6, - "column": 22 - } - }, - "body": [] - } - }, - { - "type": "ClassDeclaration", - "start": 175, - "end": 206, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 31 - } - }, - "id": { - "type": "Identifier", - "start": 181, - "end": 182, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 7 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 182, - "end": 203, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 28 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 183, - "end": 202, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 27 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 184, - "end": 193, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 18 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 186, - "end": 193, - "loc": { - "start": { - "line": 7, - "column": 11 - }, - "end": { - "line": 7, - "column": 18 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 187, - "end": 193, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 18 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 196, - "end": 202, - "loc": { - "start": { - "line": 7, - "column": 21 - }, - "end": { - "line": 7, - "column": 27 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 204, - "end": 206, - "loc": { - "start": { - "line": 7, - "column": 29 - }, - "end": { - "line": 7, - "column": 31 - } - }, - "body": [] - } - }, - { - "type": "ClassDeclaration", - "start": 207, - "end": 241, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 34 - } - }, - "id": { - "type": "Identifier", - "start": 213, - "end": 214, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 7 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 214, - "end": 238, - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 31 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 215, - "end": 216, - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 8, - "column": 9 - } - }, - "name": "S", - "variance": null - }, - { - "type": "TypeParameter", - "start": 218, - "end": 237, - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 30 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 219, - "end": 228, - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 21 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 221, - "end": 228, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 21 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 222, - "end": 228, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 21 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 231, - "end": 237, - "loc": { - "start": { - "line": 8, - "column": 24 - }, - "end": { - "line": 8, - "column": 30 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 239, - "end": 241, - "loc": { - "start": { - "line": 8, - "column": 32 - }, - "end": { - "line": 8, - "column": 34 - } - }, - "body": [] - } - }, - { - "type": "ClassDeclaration", - "start": 242, - "end": 285, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 43 - } - }, - "id": { - "type": "Identifier", - "start": 248, - "end": 249, - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 7 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 249, - "end": 282, - "loc": { - "start": { - "line": 9, - "column": 7 - }, - "end": { - "line": 9, - "column": 40 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 250, - "end": 260, - "loc": { - "start": { - "line": 9, - "column": 8 - }, - "end": { - "line": 9, - "column": 18 - } - }, - "name": "S", - "variance": null, - "default": { - "type": "NumberTypeAnnotation", - "start": 254, - "end": 260, - "loc": { - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 9, - "column": 18 - } - } - } - }, - { - "type": "TypeParameter", - "start": 262, - "end": 281, - "loc": { - "start": { - "line": 9, - "column": 20 - }, - "end": { - "line": 9, - "column": 39 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 263, - "end": 272, - "loc": { - "start": { - "line": 9, - "column": 21 - }, - "end": { - "line": 9, - "column": 30 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 265, - "end": 272, - "loc": { - "start": { - "line": 9, - "column": 23 - }, - "end": { - "line": 9, - "column": 30 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 266, - "end": 272, - "loc": { - "start": { - "line": 9, - "column": 24 - }, - "end": { - "line": 9, - "column": 30 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 275, - "end": 281, - "loc": { - "start": { - "line": 9, - "column": 33 - }, - "end": { - "line": 9, - "column": 39 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 283, - "end": 285, - "loc": { - "start": { - "line": 9, - "column": 41 - }, - "end": { - "line": 9, - "column": 43 - } - }, - "body": [] - } - }, - { - "type": "EmptyStatement", - "start": 286, - "end": 287, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - } - }, - { - "type": "ExpressionStatement", - "start": 287, - "end": 313, - "loc": { - "start": { - "line": 10, - "column": 1 - }, - "end": { - "line": 11, - "column": 1 - } - }, - "expression": { - "type": "ClassExpression", - "start": 288, - "end": 310, - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 24 - } - }, - "id": { - "type": "Identifier", - "start": 294, - "end": 295, - "loc": { - "start": { - "line": 10, - "column": 8 - }, - "end": { - "line": 10, - "column": 9 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 295, - "end": 307, - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 21 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 296, - "end": 306, - "loc": { - "start": { - "line": 10, - "column": 10 - }, - "end": { - "line": 10, - "column": 20 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "StringTypeAnnotation", - "start": 300, - "end": 306, - "loc": { - "start": { - "line": 10, - "column": 14 - }, - "end": { - "line": 10, - "column": 20 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 308, - "end": 310, - "loc": { - "start": { - "line": 10, - "column": 22 - }, - "end": { - "line": 10, - "column": 24 - } - }, - "body": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 287 - } - } - }, - { - "type": "ExpressionStatement", - "start": 313, - "end": 348, - "loc": { - "start": { - "line": 11, - "column": 1 - }, - "end": { - "line": 12, - "column": 1 - } - }, - "expression": { - "type": "ClassExpression", - "start": 314, - "end": 345, - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 33 - } - }, - "id": { - "type": "Identifier", - "start": 320, - "end": 321, - "loc": { - "start": { - "line": 11, - "column": 8 - }, - "end": { - "line": 11, - "column": 9 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 321, - "end": 342, - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 30 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 322, - "end": 341, - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 29 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 323, - "end": 332, - "loc": { - "start": { - "line": 11, - "column": 11 - }, - "end": { - "line": 11, - "column": 20 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 325, - "end": 332, - "loc": { - "start": { - "line": 11, - "column": 13 - }, - "end": { - "line": 11, - "column": 20 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 326, - "end": 332, - "loc": { - "start": { - "line": 11, - "column": 14 - }, - "end": { - "line": 11, - "column": 20 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 335, - "end": 341, - "loc": { - "start": { - "line": 11, - "column": 23 - }, - "end": { - "line": 11, - "column": 29 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 343, - "end": 345, - "loc": { - "start": { - "line": 11, - "column": 31 - }, - "end": { - "line": 11, - "column": 33 - } - }, - "body": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 313 - } - } - }, - { - "type": "ExpressionStatement", - "start": 348, - "end": 386, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 13, - "column": 1 - } - }, - "expression": { - "type": "ClassExpression", - "start": 349, - "end": 383, - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 36 - } - }, - "id": { - "type": "Identifier", - "start": 355, - "end": 356, - "loc": { - "start": { - "line": 12, - "column": 8 - }, - "end": { - "line": 12, - "column": 9 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 356, - "end": 380, - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 12, - "column": 33 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 357, - "end": 358, - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 11 - } - }, - "name": "S", - "variance": null - }, - { - "type": "TypeParameter", - "start": 360, - "end": 379, - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 12, - "column": 32 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 361, - "end": 370, - "loc": { - "start": { - "line": 12, - "column": 14 - }, - "end": { - "line": 12, - "column": 23 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 363, - "end": 370, - "loc": { - "start": { - "line": 12, - "column": 16 - }, - "end": { - "line": 12, - "column": 23 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 364, - "end": 370, - "loc": { - "start": { - "line": 12, - "column": 17 - }, - "end": { - "line": 12, - "column": 23 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 373, - "end": 379, - "loc": { - "start": { - "line": 12, - "column": 26 - }, - "end": { - "line": 12, - "column": 32 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 381, - "end": 383, - "loc": { - "start": { - "line": 12, - "column": 34 - }, - "end": { - "line": 12, - "column": 36 - } - }, - "body": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 348 - } - } - }, - { - "type": "ExpressionStatement", - "start": 386, - "end": 431, - "loc": { - "start": { - "line": 13, - "column": 1 - }, - "end": { - "line": 13, - "column": 46 - } - }, - "expression": { - "type": "ClassExpression", - "start": 387, - "end": 430, - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 45 - } - }, - "id": { - "type": "Identifier", - "start": 393, - "end": 394, - "loc": { - "start": { - "line": 13, - "column": 8 - }, - "end": { - "line": 13, - "column": 9 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 394, - "end": 427, - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 42 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 395, - "end": 405, - "loc": { - "start": { - "line": 13, - "column": 10 - }, - "end": { - "line": 13, - "column": 20 - } - }, - "name": "S", - "variance": null, - "default": { - "type": "NumberTypeAnnotation", - "start": 399, - "end": 405, - "loc": { - "start": { - "line": 13, - "column": 14 - }, - "end": { - "line": 13, - "column": 20 - } - } - } - }, - { - "type": "TypeParameter", - "start": 407, - "end": 426, - "loc": { - "start": { - "line": 13, - "column": 22 - }, - "end": { - "line": 13, - "column": 41 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 408, - "end": 417, - "loc": { - "start": { - "line": 13, - "column": 23 - }, - "end": { - "line": 13, - "column": 32 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 410, - "end": 417, - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 32 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 411, - "end": 417, - "loc": { - "start": { - "line": 13, - "column": 26 - }, - "end": { - "line": 13, - "column": 32 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 420, - "end": 426, - "loc": { - "start": { - "line": 13, - "column": 35 - }, - "end": { - "line": 13, - "column": 41 - } - } - } - } - ] - }, - "superClass": null, - "body": { - "type": "ClassBody", - "start": 428, - "end": 430, - "loc": { - "start": { - "line": 13, - "column": 43 - }, - "end": { - "line": 13, - "column": 45 - } - }, - "body": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 386 - } - } - }, - { - "type": "DeclareClass", - "start": 432, - "end": 462, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 30 - } - }, - "id": { - "type": "Identifier", - "start": 446, - "end": 447, - "loc": { - "start": { - "line": 14, - "column": 14 - }, - "end": { - "line": 14, - "column": 15 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 447, - "end": 459, - "loc": { - "start": { - "line": 14, - "column": 15 - }, - "end": { - "line": 14, - "column": 27 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 448, - "end": 458, - "loc": { - "start": { - "line": 14, - "column": 16 - }, - "end": { - "line": 14, - "column": 26 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "StringTypeAnnotation", - "start": 452, - "end": 458, - "loc": { - "start": { - "line": 14, - "column": 20 - }, - "end": { - "line": 14, - "column": 26 - } - } - } - } - ] - }, - "extends": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 460, - "end": 462, - "loc": { - "start": { - "line": 14, - "column": 28 - }, - "end": { - "line": 14, - "column": 30 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "exact": false - } - }, - { - "type": "DeclareClass", - "start": 463, - "end": 502, - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 15, - "column": 39 - } - }, - "id": { - "type": "Identifier", - "start": 477, - "end": 478, - "loc": { - "start": { - "line": 15, - "column": 14 - }, - "end": { - "line": 15, - "column": 15 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 478, - "end": 499, - "loc": { - "start": { - "line": 15, - "column": 15 - }, - "end": { - "line": 15, - "column": 36 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 479, - "end": 498, - "loc": { - "start": { - "line": 15, - "column": 16 - }, - "end": { - "line": 15, - "column": 35 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 480, - "end": 489, - "loc": { - "start": { - "line": 15, - "column": 17 - }, - "end": { - "line": 15, - "column": 26 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 482, - "end": 489, - "loc": { - "start": { - "line": 15, - "column": 19 - }, - "end": { - "line": 15, - "column": 26 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 483, - "end": 489, - "loc": { - "start": { - "line": 15, - "column": 20 - }, - "end": { - "line": 15, - "column": 26 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 492, - "end": 498, - "loc": { - "start": { - "line": 15, - "column": 29 - }, - "end": { - "line": 15, - "column": 35 - } - } - } - } - ] - }, - "extends": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 500, - "end": 502, - "loc": { - "start": { - "line": 15, - "column": 37 - }, - "end": { - "line": 15, - "column": 39 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "exact": false - } - }, - { - "type": "DeclareClass", - "start": 503, - "end": 545, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 42 - } - }, - "id": { - "type": "Identifier", - "start": 517, - "end": 518, - "loc": { - "start": { - "line": 16, - "column": 14 - }, - "end": { - "line": 16, - "column": 15 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 518, - "end": 542, - "loc": { - "start": { - "line": 16, - "column": 15 - }, - "end": { - "line": 16, - "column": 39 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 519, - "end": 520, - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 17 - } - }, - "name": "S", - "variance": null - }, - { - "type": "TypeParameter", - "start": 522, - "end": 541, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 38 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 523, - "end": 532, - "loc": { - "start": { - "line": 16, - "column": 20 - }, - "end": { - "line": 16, - "column": 29 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 525, - "end": 532, - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 29 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 526, - "end": 532, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 29 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 535, - "end": 541, - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 38 - } - } - } - } - ] - }, - "extends": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 543, - "end": 545, - "loc": { - "start": { - "line": 16, - "column": 40 - }, - "end": { - "line": 16, - "column": 42 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "exact": false - } - }, - { - "type": "DeclareClass", - "start": 546, - "end": 597, - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 51 - } - }, - "id": { - "type": "Identifier", - "start": 560, - "end": 561, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 561, - "end": 594, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 48 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 562, - "end": 572, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 26 - } - }, - "name": "S", - "variance": null, - "default": { - "type": "NumberTypeAnnotation", - "start": 566, - "end": 572, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - } - }, - { - "type": "TypeParameter", - "start": 574, - "end": 593, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 47 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 575, - "end": 584, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 38 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 577, - "end": 584, - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 38 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 578, - "end": 584, - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 38 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 587, - "end": 593, - "loc": { - "start": { - "line": 17, - "column": 41 - }, - "end": { - "line": 17, - "column": 47 - } - } - } - } - ] - }, - "extends": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 595, - "end": 597, - "loc": { - "start": { - "line": 17, - "column": 49 - }, - "end": { - "line": 17, - "column": 51 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "exact": false - } - }, - { - "type": "InterfaceDeclaration", - "start": 598, - "end": 624, - "loc": { - "start": { - "line": 18, - "column": 0 - }, - "end": { - "line": 18, - "column": 26 - } - }, - "id": { - "type": "Identifier", - "start": 608, - "end": 609, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 609, - "end": 621, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 23 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 610, - "end": 620, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 22 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "StringTypeAnnotation", - "start": 614, - "end": 620, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 22 - } - } - } - } - ] - }, - "extends": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 622, - "end": 624, - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 26 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "exact": false - } - }, - { - "type": "InterfaceDeclaration", - "start": 625, - "end": 660, - "loc": { - "start": { - "line": 19, - "column": 0 - }, - "end": { - "line": 19, - "column": 35 - } - }, - "id": { - "type": "Identifier", - "start": 635, - "end": 636, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 636, - "end": 657, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 32 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 637, - "end": 656, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 31 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 638, - "end": 647, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 22 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 640, - "end": 647, - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 22 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 641, - "end": 647, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 22 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 650, - "end": 656, - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 31 - } - } - } - } - ] - }, - "extends": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 658, - "end": 660, - "loc": { - "start": { - "line": 19, - "column": 33 - }, - "end": { - "line": 19, - "column": 35 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "exact": false - } - }, - { - "type": "InterfaceDeclaration", - "start": 661, - "end": 699, - "loc": { - "start": { - "line": 20, - "column": 0 - }, - "end": { - "line": 20, - "column": 38 - } - }, - "id": { - "type": "Identifier", - "start": 671, - "end": 672, - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 11 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 672, - "end": 696, - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 35 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 673, - "end": 674, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 13 - } - }, - "name": "S", - "variance": null - }, - { - "type": "TypeParameter", - "start": 676, - "end": 695, - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 34 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 677, - "end": 686, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 25 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 679, - "end": 686, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 25 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 680, - "end": 686, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 25 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 689, - "end": 695, - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 34 - } - } - } - } - ] - }, - "extends": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 697, - "end": 699, - "loc": { - "start": { - "line": 20, - "column": 36 - }, - "end": { - "line": 20, - "column": 38 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "exact": false - } - }, - { - "type": "InterfaceDeclaration", - "start": 700, - "end": 747, - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 47 - } - }, - "id": { - "type": "Identifier", - "start": 710, - "end": 711, - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 11 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 711, - "end": 744, - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 44 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 712, - "end": 722, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 22 - } - }, - "name": "S", - "variance": null, - "default": { - "type": "NumberTypeAnnotation", - "start": 716, - "end": 722, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 22 - } - } - } - }, - { - "type": "TypeParameter", - "start": 724, - "end": 743, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 43 - } - }, - "name": "T", - "variance": null, - "bound": { - "type": "TypeAnnotation", - "start": 725, - "end": 734, - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 34 - } - }, - "typeAnnotation": { - "type": "NullableTypeAnnotation", - "start": 727, - "end": 734, - "loc": { - "start": { - "line": 21, - "column": 27 - }, - "end": { - "line": 21, - "column": 34 - } - }, - "typeAnnotation": { - "type": "StringTypeAnnotation", - "start": 728, - "end": 734, - "loc": { - "start": { - "line": 21, - "column": 28 - }, - "end": { - "line": 21, - "column": 34 - } - } - } - } - }, - "default": { - "type": "StringTypeAnnotation", - "start": 737, - "end": 743, - "loc": { - "start": { - "line": 21, - "column": 37 - }, - "end": { - "line": 21, - "column": 43 - } - } - } - } - ] - }, - "extends": [], - "mixins": [], - "body": { - "type": "ObjectTypeAnnotation", - "start": 745, - "end": 747, - "loc": { - "start": { - "line": 21, - "column": 45 - }, - "end": { - "line": 21, - "column": 47 - } - }, - "callProperties": [], - "properties": [], - "indexers": [], - "exact": false - } - }, - { - "type": "TypeAlias", - "start": 748, - "end": 768, - "loc": { - "start": { - "line": 22, - "column": 0 - }, - "end": { - "line": 22, - "column": 20 - } - }, - "id": { - "type": "Identifier", - "start": 753, - "end": 754, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - }, - "identifierName": "A" - }, - "name": "A" - }, - "typeParameters": { - "type": "TypeParameterDeclaration", - "start": 754, - "end": 764, - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 16 - } - }, - "params": [ - { - "type": "TypeParameter", - "start": 755, - "end": 763, - "loc": { - "start": { - "line": 22, - "column": 7 - }, - "end": { - "line": 22, - "column": 15 - } - }, - "name": "T", - "variance": null, - "default": { - "type": "VoidTypeAnnotation", - "start": 759, - "end": 763, - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 15 - } - } - } - } - ] - }, - "right": { - "type": "GenericTypeAnnotation", - "start": 767, - "end": 768, - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 20 - } - }, - "typeParameters": null, - "id": { - "type": "Identifier", - "start": 767, - "end": 768, - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 20 - }, - "identifierName": "T" - }, - "name": "T" - } - } - } - ], - "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..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 @@ -81,7 +81,7 @@ { "type": "ObjectTypeProperty", "start": 16, - "end": 34, + "end": 33, "loc": { "start": { "line": 2, @@ -89,9 +89,28 @@ }, "end": { "line": 2, - "column": 20 + "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, @@ -137,7 +156,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -157,30 +177,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 37, - "end": 55, + "end": 54, "loc": { "start": { "line": 3, @@ -188,9 +190,28 @@ }, "end": { "line": 3, - "column": 20 + "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, @@ -236,7 +257,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -256,30 +278,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 58, - "end": 75, + "end": 74, "loc": { "start": { "line": 4, @@ -287,9 +291,28 @@ }, "end": { "line": 4, - "column": 19 + "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, @@ -335,7 +358,8 @@ "column": 9 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -355,30 +379,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 78, - "end": 92, + "end": 91, "loc": { "start": { "line": 5, @@ -386,9 +392,28 @@ }, "end": { "line": 5, - "column": 16 + "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, @@ -434,7 +459,8 @@ "column": 6 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -454,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/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..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 @@ -79,7 +79,7 @@ { "type": "ObjectTypeProperty", "start": 13, - "end": 31, + "end": 30, "loc": { "start": { "line": 2, @@ -87,9 +87,28 @@ }, "end": { "line": 2, - "column": 20 + "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, @@ -135,7 +154,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -155,30 +175,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 34, - "end": 52, + "end": 51, "loc": { "start": { "line": 3, @@ -186,9 +188,28 @@ }, "end": { "line": 3, - "column": 20 + "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, @@ -234,7 +255,8 @@ "column": 10 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -254,30 +276,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 55, - "end": 72, + "end": 71, "loc": { "start": { "line": 4, @@ -285,9 +289,28 @@ }, "end": { "line": 4, - "column": 19 + "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, @@ -333,7 +356,8 @@ "column": 9 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -353,30 +377,12 @@ } } }, - "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 }, { "type": "ObjectTypeProperty", "start": 75, - "end": 89, + "end": 88, "loc": { "start": { "line": 5, @@ -384,9 +390,28 @@ }, "end": { "line": 5, - "column": 16 + "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, @@ -432,7 +457,8 @@ "column": 6 } }, - "name": "T" + "name": "T", + "variance": null } ] }, @@ -452,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/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..e41a4f7b34 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" }, @@ -214,7 +216,7 @@ { "type": "ObjectTypeProperty", "start": 24, - "end": 36, + "end": 35, "loc": { "start": { "line": 1, @@ -222,7 +224,7 @@ }, "end": { "line": 1, - "column": 36 + "column": 35 } }, "key": { @@ -237,10 +239,13 @@ "end": { "line": 1, "column": 27 - } + }, + "identifierName": "xxx" }, "name": "xxx" }, + "static": false, + "kind": "init", "value": { "type": "NumberTypeAnnotation", "start": 29, @@ -256,8 +261,8 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false }, { "type": "ObjectTypeProperty", @@ -285,10 +290,13 @@ "end": { "line": 1, "column": 40 - } + }, + "identifierName": "yyy" }, "name": "yyy" }, + "static": false, + "kind": "init", "value": { "type": "StringTypeAnnotation", "start": 42, @@ -304,15 +312,17 @@ } } }, - "optional": false, - "variance": null + "variance": null, + "optional": false } ], - "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/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/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..30be28155d 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" } @@ -146,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 e9df7bec55..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" } }, @@ -193,7 +199,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..2fa06f64c8 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" } @@ -167,7 +168,10 @@ "column": 13 } }, - "extra": null, + "extra": { + "rawValue": " ", + "raw": " " + }, "value": " " }, { @@ -196,7 +200,8 @@ "end": { "line": 1, "column": 25 - } + }, + "identifierName": "children" }, "name": "children" } @@ -227,7 +232,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "a" }, "name": "a" } @@ -258,7 +264,8 @@ "end": { "line": 1, "column": 34 - } + }, + "identifierName": "b" }, "name": "b" } @@ -268,6 +275,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..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": " " }, { @@ -244,7 +250,8 @@ "end": { "line": 1, "column": 22 - } + }, + "identifierName": "value" }, "name": "value" } @@ -263,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/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/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/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 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/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/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/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/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/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/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/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..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" } }, @@ -145,7 +148,8 @@ "end": { "line": 1, "column": 28 - } + }, + "identifierName": "props" }, "name": "props" } 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-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/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 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": ["*"] -} diff --git a/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren-white/expected.json b/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren-white/expected.json index 9cbde09c08..9cb82e8036 100644 --- a/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren-white/expected.json +++ b/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren-white/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren/expected.json b/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren/expected.json index 607ddfb0bc..886e2d990c 100644 --- a/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren/expected.json +++ b/test/fixtures/lightscript/arrow-expressions/fat-async-no-paren/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/arrow-methods/class-set/expected.json b/test/fixtures/lightscript/arrow-methods/class-set/expected.json index 5624a70e6d..f6a22cc2c5 100644 --- a/test/fixtures/lightscript/arrow-methods/class-set/expected.json +++ b/test/fixtures/lightscript/arrow-methods/class-set/expected.json @@ -89,6 +89,7 @@ "column": 14 } }, + "static": false, "computed": false, "key": { "type": "Identifier", @@ -107,7 +108,6 @@ }, "name": "method" }, - "static": false, "kind": "set", "id": null, "generator": false, @@ -241,7 +241,8 @@ "identifierName": "x" }, "name": "x" - } + }, + "isNowAssign": false } } ], diff --git a/test/fixtures/lightscript/arrow-methods/obj-async-arrow/expected.json b/test/fixtures/lightscript/arrow-methods/obj-async-arrow/expected.json index 7ece17f88a..c5b34ea20c 100644 --- a/test/fixtures/lightscript/arrow-methods/obj-async-arrow/expected.json +++ b/test/fixtures/lightscript/arrow-methods/obj-async-arrow/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/arrow-methods/obj-commaless-oneline/expected.json b/test/fixtures/lightscript/arrow-methods/obj-commaless-oneline/expected.json index ecdec18825..b93728d7fd 100644 --- a/test/fixtures/lightscript/arrow-methods/obj-commaless-oneline/expected.json +++ b/test/fixtures/lightscript/arrow-methods/obj-commaless-oneline/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/arrow-methods/obj-commaless/expected.json b/test/fixtures/lightscript/arrow-methods/obj-commaless/expected.json index 16a3d43b23..c25e475f4f 100644 --- a/test/fixtures/lightscript/arrow-methods/obj-commaless/expected.json +++ b/test/fixtures/lightscript/arrow-methods/obj-commaless/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/arrow-methods/obj-computed-void/expected.json b/test/fixtures/lightscript/arrow-methods/obj-computed-void/expected.json index 3977b1c8da..756dfaa630 100644 --- a/test/fixtures/lightscript/arrow-methods/obj-computed-void/expected.json +++ b/test/fixtures/lightscript/arrow-methods/obj-computed-void/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/arrow-methods/obj-get/expected.json b/test/fixtures/lightscript/arrow-methods/obj-get/expected.json index db8ba986db..7067b65610 100644 --- a/test/fixtures/lightscript/arrow-methods/obj-get/expected.json +++ b/test/fixtures/lightscript/arrow-methods/obj-get/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/arrow-methods/obj-oneline/expected.json b/test/fixtures/lightscript/arrow-methods/obj-oneline/expected.json index 0e9dade2d1..26f67862dd 100644 --- a/test/fixtures/lightscript/arrow-methods/obj-oneline/expected.json +++ b/test/fixtures/lightscript/arrow-methods/obj-oneline/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/arrow-methods/obj-set/expected.json b/test/fixtures/lightscript/arrow-methods/obj-set/expected.json index 55c568996d..cead60493d 100644 --- a/test/fixtures/lightscript/arrow-methods/obj-set/expected.json +++ b/test/fixtures/lightscript/arrow-methods/obj-set/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/arrow-methods/obj-skinny-void/expected.json b/test/fixtures/lightscript/arrow-methods/obj-skinny-void/expected.json index 15ed89696b..2b2c810842 100644 --- a/test/fixtures/lightscript/arrow-methods/obj-skinny-void/expected.json +++ b/test/fixtures/lightscript/arrow-methods/obj-skinny-void/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/arrow-methods/obj-skinny/expected.json b/test/fixtures/lightscript/arrow-methods/obj-skinny/expected.json index c2675f7c22..15a9ac87e7 100644 --- a/test/fixtures/lightscript/arrow-methods/obj-skinny/expected.json +++ b/test/fixtures/lightscript/arrow-methods/obj-skinny/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-1/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-1/expected.json index 2d4e2da3a3..4f0242aa3e 100644 --- a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-1/expected.json +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-1/expected.json @@ -208,7 +208,10 @@ "column": 2 } }, - "extra": null, + "extra": { + "rawValue": "\n ", + "raw": "\n " + }, "value": "\n " }, { @@ -304,7 +307,10 @@ "column": 9 } }, - "extra": null, + "extra": { + "rawValue": "hi", + "raw": "hi" + }, "value": "hi" } ] @@ -323,7 +329,10 @@ "column": 2 } }, - "extra": null, + "extra": { + "rawValue": "\n ", + "raw": "\n " + }, "value": "\n " }, { @@ -419,7 +428,10 @@ "column": 12 } }, - "extra": null, + "extra": { + "rawValue": "hello", + "raw": "hello" + }, "value": "hello" } ] @@ -438,7 +450,10 @@ "column": 0 } }, - "extra": null, + "extra": { + "rawValue": "\n", + "raw": "\n" + }, "value": "\n" } ] @@ -447,4 +462,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-4/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-4/expected.json index 08abe59e17..0275e795d2 100644 --- a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-4/expected.json +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-opening-4/expected.json @@ -135,7 +135,10 @@ "column": 2 } }, - "extra": null, + "extra": { + "rawValue": "\n ", + "raw": "\n " + }, "value": "\n " }, { @@ -231,7 +234,10 @@ "column": 9 } }, - "extra": null, + "extra": { + "rawValue": "hi", + "raw": "hi" + }, "value": "hi" } ] @@ -250,7 +256,10 @@ "column": 2 } }, - "extra": null, + "extra": { + "rawValue": "\n ", + "raw": "\n " + }, "value": "\n " }, { @@ -346,7 +355,10 @@ "column": 12 } }, - "extra": null, + "extra": { + "rawValue": "hello", + "raw": "hello" + }, "value": "hello" } ] @@ -365,7 +377,10 @@ "column": 0 } }, - "extra": null, + "extra": { + "rawValue": "\n", + "raw": "\n" + }, "value": "\n" } ] @@ -374,4 +389,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-self-closing/expected.json b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-self-closing/expected.json index a9db746b35..31316dc183 100644 --- a/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-self-closing/expected.json +++ b/test/fixtures/lightscript/automatic-semicolon-insertion/jsx-self-closing/expected.json @@ -93,7 +93,7 @@ "children": [] } } - ] - }, - "comments": [] + ], + "directives": [] + } } \ No newline at end of file diff --git a/test/fixtures/lightscript/await-arrow/assign-arr/expected.json b/test/fixtures/lightscript/await-arrow/assign-arr/expected.json index 735465fcc7..df09edbf18 100644 --- a/test/fixtures/lightscript/await-arrow/assign-arr/expected.json +++ b/test/fixtures/lightscript/await-arrow/assign-arr/expected.json @@ -94,6 +94,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/await-arrow/assign-obj/expected.json b/test/fixtures/lightscript/await-arrow/assign-obj/expected.json index d848e3e47b..0e97f1e0d9 100644 --- a/test/fixtures/lightscript/await-arrow/assign-obj/expected.json +++ b/test/fixtures/lightscript/await-arrow/assign-obj/expected.json @@ -94,6 +94,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/await-arrow/assign-return/expected.json b/test/fixtures/lightscript/await-arrow/assign-return/expected.json index 9be422a329..e70cd7a2fa 100644 --- a/test/fixtures/lightscript/await-arrow/assign-return/expected.json +++ b/test/fixtures/lightscript/await-arrow/assign-return/expected.json @@ -94,6 +94,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/await-arrow/assign/expected.json b/test/fixtures/lightscript/await-arrow/assign/expected.json index 49bb298581..91bac3041d 100644 --- a/test/fixtures/lightscript/await-arrow/assign/expected.json +++ b/test/fixtures/lightscript/await-arrow/assign/expected.json @@ -94,6 +94,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/await-arrow/prop-assign/expected.json b/test/fixtures/lightscript/await-arrow/prop-assign/expected.json index 106970a2b5..6ef17ab480 100644 --- a/test/fixtures/lightscript/await-arrow/prop-assign/expected.json +++ b/test/fixtures/lightscript/await-arrow/prop-assign/expected.json @@ -205,7 +205,8 @@ }, "arguments": [] } - } + }, + "isNowAssign": false } } ], diff --git a/test/fixtures/lightscript/await-arrow/safe-assign/expected.json b/test/fixtures/lightscript/await-arrow/safe-assign/expected.json index ffe21d64f0..f4e1d03439 100644 --- a/test/fixtures/lightscript/await-arrow/safe-assign/expected.json +++ b/test/fixtures/lightscript/await-arrow/safe-assign/expected.json @@ -94,6 +94,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/await-arrow/typed-assign/expected.json b/test/fixtures/lightscript/await-arrow/typed-assign/expected.json index 3859f1092c..3cf5883d88 100644 --- a/test/fixtures/lightscript/await-arrow/typed-assign/expected.json +++ b/test/fixtures/lightscript/await-arrow/typed-assign/expected.json @@ -94,6 +94,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/await-arrow/typed-safe-assign/expected.json b/test/fixtures/lightscript/await-arrow/typed-safe-assign/expected.json index b69f9e37f9..adf9435f72 100644 --- a/test/fixtures/lightscript/await-arrow/typed-safe-assign/expected.json +++ b/test/fixtures/lightscript/await-arrow/typed-safe-assign/expected.json @@ -94,6 +94,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/blocks/anonymous-blocks/expected.json b/test/fixtures/lightscript/blocks/anonymous-blocks/expected.json index 8ee602ab4c..81daa3a959 100644 --- a/test/fixtures/lightscript/blocks/anonymous-blocks/expected.json +++ b/test/fixtures/lightscript/blocks/anonymous-blocks/expected.json @@ -94,6 +94,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", @@ -179,6 +182,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", @@ -282,4 +288,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/lightscript/commaless/obj-basic/expected.json b/test/fixtures/lightscript/commaless/obj-basic/expected.json index f02162a054..de5aa3b02a 100644 --- a/test/fixtures/lightscript/commaless/obj-basic/expected.json +++ b/test/fixtures/lightscript/commaless/obj-basic/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/commaless/obj-computed-async-key/expected.json b/test/fixtures/lightscript/commaless/obj-computed-async-key/expected.json index 5ec6dbe169..9860fa6f3e 100644 --- a/test/fixtures/lightscript/commaless/obj-computed-async-key/expected.json +++ b/test/fixtures/lightscript/commaless/obj-computed-async-key/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", @@ -123,6 +126,7 @@ }, "name": "async" }, + "computed": false, "value": { "type": "Identifier", "start": 8, diff --git a/test/fixtures/lightscript/commaless/obj-computed-get-key/expected.json b/test/fixtures/lightscript/commaless/obj-computed-get-key/expected.json index 0e69c02f19..7f2f42a211 100644 --- a/test/fixtures/lightscript/commaless/obj-computed-get-key/expected.json +++ b/test/fixtures/lightscript/commaless/obj-computed-get-key/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/commaless/obj-computed-set-key/expected.json b/test/fixtures/lightscript/commaless/obj-computed-set-key/expected.json index 0158f922cb..28aa0627c5 100644 --- a/test/fixtures/lightscript/commaless/obj-computed-set-key/expected.json +++ b/test/fixtures/lightscript/commaless/obj-computed-set-key/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/commaless/obj-computed/expected.json b/test/fixtures/lightscript/commaless/obj-computed/expected.json index 379134dcc3..38dac1a8cf 100644 --- a/test/fixtures/lightscript/commaless/obj-computed/expected.json +++ b/test/fixtures/lightscript/commaless/obj-computed/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/commaless/obj-generator/expected.json b/test/fixtures/lightscript/commaless/obj-generator/expected.json index 0efaa6d492..96e7f83c07 100644 --- a/test/fixtures/lightscript/commaless/obj-generator/expected.json +++ b/test/fixtures/lightscript/commaless/obj-generator/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/commaless/obj-methods/expected.json b/test/fixtures/lightscript/commaless/obj-methods/expected.json index 73cac13172..7c69d5eb03 100644 --- a/test/fixtures/lightscript/commaless/obj-methods/expected.json +++ b/test/fixtures/lightscript/commaless/obj-methods/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/commaless/obj-mixed/expected.json b/test/fixtures/lightscript/commaless/obj-mixed/expected.json index cdca80bbf4..2fdf9aadc7 100644 --- a/test/fixtures/lightscript/commaless/obj-mixed/expected.json +++ b/test/fixtures/lightscript/commaless/obj-mixed/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/commaless/obj-redundant/expected.json b/test/fixtures/lightscript/commaless/obj-redundant/expected.json index bc6cb18cca..b1da5c7198 100644 --- a/test/fixtures/lightscript/commaless/obj-redundant/expected.json +++ b/test/fixtures/lightscript/commaless/obj-redundant/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/comprehension/nested-for/expected.json b/test/fixtures/lightscript/comprehension/nested-for/expected.json index f1e3997feb..b1b693b337 100644 --- a/test/fixtures/lightscript/comprehension/nested-for/expected.json +++ b/test/fixtures/lightscript/comprehension/nested-for/expected.json @@ -70,6 +70,7 @@ "column": 42 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -151,6 +152,7 @@ "column": 42 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 22, diff --git a/test/fixtures/lightscript/comprehension/object-nested-for/expected.json b/test/fixtures/lightscript/comprehension/object-nested-for/expected.json index 18f94ddd0a..5dc413aa96 100644 --- a/test/fixtures/lightscript/comprehension/object-nested-for/expected.json +++ b/test/fixtures/lightscript/comprehension/object-nested-for/expected.json @@ -71,6 +71,7 @@ "column": 43 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 5, @@ -152,6 +153,7 @@ "column": 43 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 22, diff --git a/test/fixtures/lightscript/comprehension/object-paren-curly/expected.json b/test/fixtures/lightscript/comprehension/object-paren-curly/expected.json index a3fac92efb..2162bed4f4 100644 --- a/test/fixtures/lightscript/comprehension/object-paren-curly/expected.json +++ b/test/fixtures/lightscript/comprehension/object-paren-curly/expected.json @@ -71,6 +71,9 @@ "column": 36 } }, + "extra": { + "hasParens": true + }, "idx": { "type": "Identifier", "start": 11, diff --git a/test/fixtures/lightscript/comprehension/paren-curly/expected.json b/test/fixtures/lightscript/comprehension/paren-curly/expected.json index c99df6c5e8..00a528d862 100644 --- a/test/fixtures/lightscript/comprehension/paren-curly/expected.json +++ b/test/fixtures/lightscript/comprehension/paren-curly/expected.json @@ -70,6 +70,9 @@ "column": 27 } }, + "extra": { + "hasParens": true + }, "init": { "type": "AssignmentExpression", "start": 6, diff --git a/test/fixtures/lightscript/for-in/keyword-reuse/expected.json b/test/fixtures/lightscript/for-in/keyword-reuse/expected.json index e284c529af..03213ae93c 100644 --- a/test/fixtures/lightscript/for-in/keyword-reuse/expected.json +++ b/test/fixtures/lightscript/for-in/keyword-reuse/expected.json @@ -42,6 +42,7 @@ "column": 23 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 4, diff --git a/test/fixtures/lightscript/for-in/now-valid-expr/expected.json b/test/fixtures/lightscript/for-in/now-valid-expr/expected.json index 44a32c4cc9..35e9866fac 100644 --- a/test/fixtures/lightscript/for-in/now-valid-expr/expected.json +++ b/test/fixtures/lightscript/for-in/now-valid-expr/expected.json @@ -42,6 +42,10 @@ "column": 24 } }, + "extra": { + "hasParens": true + }, + "await": false, "left": { "type": "ObjectPattern", "start": 36, @@ -151,7 +155,8 @@ } } ], - "leadingComments": null + "leadingComments": null, + "isNowAssign": true }, "right": { "type": "Identifier", diff --git a/test/fixtures/lightscript/for-in/now-vanilla-for/expected.json b/test/fixtures/lightscript/for-in/now-vanilla-for/expected.json index ebb99384bf..efc3511741 100644 --- a/test/fixtures/lightscript/for-in/now-vanilla-for/expected.json +++ b/test/fixtures/lightscript/for-in/now-vanilla-for/expected.json @@ -42,6 +42,10 @@ "column": 30 } }, + "extra": { + "hasParens": true + }, + "await": false, "left": { "type": "Identifier", "start": 34, @@ -58,7 +62,8 @@ "identifierName": "x" }, "name": "x", - "leadingComments": null + "leadingComments": null, + "isNowAssign": true }, "right": { "type": "Identifier", diff --git a/test/fixtures/lightscript/for-in/now/expected.json b/test/fixtures/lightscript/for-in/now/expected.json index d8249777ef..6b92e56fb5 100644 --- a/test/fixtures/lightscript/for-in/now/expected.json +++ b/test/fixtures/lightscript/for-in/now/expected.json @@ -42,6 +42,7 @@ "column": 20 } }, + "await": false, "left": { "type": "Identifier", "start": 8, @@ -57,7 +58,8 @@ }, "identifierName": "k" }, - "name": "k" + "name": "k", + "isNowAssign": true }, "right": { "type": "Identifier", diff --git a/test/fixtures/lightscript/for-of/array-pattern/expected.json b/test/fixtures/lightscript/for-of/array-pattern/expected.json index 4971180d1e..d06cd894d7 100644 --- a/test/fixtures/lightscript/for-of/array-pattern/expected.json +++ b/test/fixtures/lightscript/for-of/array-pattern/expected.json @@ -42,6 +42,10 @@ "column": 22 } }, + "extra": { + "hasParens": true + }, + "await": false, "left": { "type": "ArrayPattern", "start": 9, diff --git a/test/fixtures/lightscript/for-of/basic/expected.json b/test/fixtures/lightscript/for-of/basic/expected.json index 4544ae8959..b1aec754c0 100644 --- a/test/fixtures/lightscript/for-of/basic/expected.json +++ b/test/fixtures/lightscript/for-of/basic/expected.json @@ -42,6 +42,10 @@ "column": 30 } }, + "extra": { + "hasParens": true + }, + "await": false, "left": { "type": "Identifier", "start": 8, diff --git a/test/fixtures/lightscript/for-of/object-pattern/expected.json b/test/fixtures/lightscript/for-of/object-pattern/expected.json index 1077db8766..0acaba3d32 100644 --- a/test/fixtures/lightscript/for-of/object-pattern/expected.json +++ b/test/fixtures/lightscript/for-of/object-pattern/expected.json @@ -42,6 +42,10 @@ "column": 22 } }, + "extra": { + "hasParens": true + }, + "await": false, "left": { "type": "ObjectPattern", "start": 9, diff --git a/test/fixtures/lightscript/for/with-now/expected.json b/test/fixtures/lightscript/for/with-now/expected.json index 0ff861e00d..152991c143 100644 --- a/test/fixtures/lightscript/for/with-now/expected.json +++ b/test/fixtures/lightscript/for/with-now/expected.json @@ -42,6 +42,9 @@ "column": 28 } }, + "extra": { + "hasParens": true + }, "init": { "type": "AssignmentExpression", "start": 5, diff --git a/test/fixtures/lightscript/if-expression/block-then-oneline/expected.json b/test/fixtures/lightscript/if-expression/block-then-oneline/expected.json index 1abdb2b435..ad88e63264 100644 --- a/test/fixtures/lightscript/if-expression/block-then-oneline/expected.json +++ b/test/fixtures/lightscript/if-expression/block-then-oneline/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/if-expression/elif/expected.json b/test/fixtures/lightscript/if-expression/elif/expected.json index e75104f008..5e1209fcb7 100644 --- a/test/fixtures/lightscript/if-expression/elif/expected.json +++ b/test/fixtures/lightscript/if-expression/elif/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/if-expression/else-if/expected.json b/test/fixtures/lightscript/if-expression/else-if/expected.json index 5acad0015a..99e9458109 100644 --- a/test/fixtures/lightscript/if-expression/else-if/expected.json +++ b/test/fixtures/lightscript/if-expression/else-if/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/if-expression/no-alternate/expected.json b/test/fixtures/lightscript/if-expression/no-alternate/expected.json index 571753e36e..941b7b64e9 100644 --- a/test/fixtures/lightscript/if-expression/no-alternate/expected.json +++ b/test/fixtures/lightscript/if-expression/no-alternate/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/if-expression/oneline/expected.json b/test/fixtures/lightscript/if-expression/oneline/expected.json index 3f54e70167..c32a3586f5 100644 --- a/test/fixtures/lightscript/if-expression/oneline/expected.json +++ b/test/fixtures/lightscript/if-expression/oneline/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/named-arrow-functions/default-params/expected.json b/test/fixtures/lightscript/named-arrow-functions/default-params/expected.json index a751e9233f..67647d4c19 100644 --- a/test/fixtures/lightscript/named-arrow-functions/default-params/expected.json +++ b/test/fixtures/lightscript/named-arrow-functions/default-params/expected.json @@ -113,7 +113,8 @@ "raw": "1" }, "value": 1 - } + }, + "isNowAssign": false } ], "skinny": true, diff --git a/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-assign/expected.json b/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-assign/expected.json index dc55180c5d..2e70884989 100644 --- a/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-assign/expected.json +++ b/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-assign/expected.json @@ -94,6 +94,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-colon-const/expected.json b/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-colon-const/expected.json index dc55180c5d..2e70884989 100644 --- a/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-colon-const/expected.json +++ b/test/fixtures/lightscript/named-arrow-functions/destructured-first-child-colon-const/expected.json @@ -94,6 +94,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn/expected.json b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn/expected.json index 1f9c8a7fd4..02d04da0f2 100644 --- a/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn/expected.json +++ b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-arrow-fn/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/named-arrow-functions/if-call-colon-named-arrow-fn/expected.json b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-named-arrow-fn/expected.json index 45ed80a216..7697a18099 100644 --- a/test/fixtures/lightscript/named-arrow-functions/if-call-colon-named-arrow-fn/expected.json +++ b/test/fixtures/lightscript/named-arrow-functions/if-call-colon-named-arrow-fn/expected.json @@ -43,6 +43,9 @@ } }, "kind": "const", + "extra": { + "implicit": true + }, "declarations": [ { "type": "VariableDeclarator", diff --git a/test/fixtures/lightscript/named-arrow-functions/skinny-params/expected.json b/test/fixtures/lightscript/named-arrow-functions/skinny-params/expected.json index 2f28ba86d8..f3287da91e 100644 --- a/test/fixtures/lightscript/named-arrow-functions/skinny-params/expected.json +++ b/test/fixtures/lightscript/named-arrow-functions/skinny-params/expected.json @@ -130,7 +130,8 @@ "raw": "1" }, "value": 1 - } + }, + "isNowAssign": false } ], "skinny": true, diff --git a/test/fixtures/lightscript/named-arrow-functions/typed-default-params/expected.json b/test/fixtures/lightscript/named-arrow-functions/typed-default-params/expected.json index c2eb1d2f15..28cd73383d 100644 --- a/test/fixtures/lightscript/named-arrow-functions/typed-default-params/expected.json +++ b/test/fixtures/lightscript/named-arrow-functions/typed-default-params/expected.json @@ -161,7 +161,8 @@ "raw": "1" }, "value": 1 - } + }, + "isNowAssign": false } ], "skinny": true, diff --git a/test/fixtures/lightscript/now-reassignment/in-expression/expected.json b/test/fixtures/lightscript/now-reassignment/in-expression/expected.json index 6399e89e7e..446bbdaa4b 100644 --- a/test/fixtures/lightscript/now-reassignment/in-expression/expected.json +++ b/test/fixtures/lightscript/now-reassignment/in-expression/expected.json @@ -164,7 +164,8 @@ }, "value": 4 }, - "isNowAssign": true + "isNowAssign": true, + "extra": {} }, "consequent": { "type": "BlockStatement", diff --git a/test/fixtures/lightscript/operators/and/expected.json b/test/fixtures/lightscript/operators/and/expected.json index a4d723065e..c1c4a779ed 100644 --- a/test/fixtures/lightscript/operators/and/expected.json +++ b/test/fixtures/lightscript/operators/and/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/lightscript/operators/or/expected.json b/test/fixtures/lightscript/operators/or/expected.json index a9dd3c7041..3dbff25ba9 100644 --- a/test/fixtures/lightscript/operators/or/expected.json +++ b/test/fixtures/lightscript/operators/or/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/lightscript/paren-free/for-in-colon/expected.json b/test/fixtures/lightscript/paren-free/for-in-colon/expected.json index 79e93f9406..361421d912 100644 --- a/test/fixtures/lightscript/paren-free/for-in-colon/expected.json +++ b/test/fixtures/lightscript/paren-free/for-in-colon/expected.json @@ -42,6 +42,7 @@ "column": 22 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 4, diff --git a/test/fixtures/lightscript/paren-free/for-in/expected.json b/test/fixtures/lightscript/paren-free/for-in/expected.json index 82f790431a..1f68bdd102 100644 --- a/test/fixtures/lightscript/paren-free/for-in/expected.json +++ b/test/fixtures/lightscript/paren-free/for-in/expected.json @@ -42,6 +42,7 @@ "column": 22 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 4, diff --git a/test/fixtures/lightscript/paren-free/for-of-colon/expected.json b/test/fixtures/lightscript/paren-free/for-of-colon/expected.json index 98397dc998..235d950237 100644 --- a/test/fixtures/lightscript/paren-free/for-of-colon/expected.json +++ b/test/fixtures/lightscript/paren-free/for-of-colon/expected.json @@ -42,6 +42,7 @@ "column": 22 } }, + "await": false, "left": { "type": "ObjectPattern", "start": 8, diff --git a/test/fixtures/lightscript/paren-free/for-of-const-destructured-array/expected.json b/test/fixtures/lightscript/paren-free/for-of-const-destructured-array/expected.json index 7b6dfccc31..61142fbed8 100644 --- a/test/fixtures/lightscript/paren-free/for-of-const-destructured-array/expected.json +++ b/test/fixtures/lightscript/paren-free/for-of-const-destructured-array/expected.json @@ -42,6 +42,7 @@ "column": 22 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 4, diff --git a/test/fixtures/lightscript/paren-free/for-of-const-destructured/expected.json b/test/fixtures/lightscript/paren-free/for-of-const-destructured/expected.json index 0ec9e4efd3..0be9afded2 100644 --- a/test/fixtures/lightscript/paren-free/for-of-const-destructured/expected.json +++ b/test/fixtures/lightscript/paren-free/for-of-const-destructured/expected.json @@ -42,6 +42,7 @@ "column": 26 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 4, diff --git a/test/fixtures/lightscript/paren-free/for-of-const/expected.json b/test/fixtures/lightscript/paren-free/for-of-const/expected.json index f0e4d7b3b8..0b86a11e83 100644 --- a/test/fixtures/lightscript/paren-free/for-of-const/expected.json +++ b/test/fixtures/lightscript/paren-free/for-of-const/expected.json @@ -42,6 +42,7 @@ "column": 24 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 4, diff --git a/test/fixtures/lightscript/paren-free/for-of/expected.json b/test/fixtures/lightscript/paren-free/for-of/expected.json index 731a459a2e..d5cbfba776 100644 --- a/test/fixtures/lightscript/paren-free/for-of/expected.json +++ b/test/fixtures/lightscript/paren-free/for-of/expected.json @@ -42,6 +42,7 @@ "column": 22 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 4, diff --git a/test/fixtures/lightscript/paren-free/paren-block-no-space/expected.json b/test/fixtures/lightscript/paren-free/paren-block-no-space/expected.json index adf7b67150..7c647904f5 100644 --- a/test/fixtures/lightscript/paren-free/paren-block-no-space/expected.json +++ b/test/fixtures/lightscript/paren-free/paren-block-no-space/expected.json @@ -57,7 +57,8 @@ }, "identifierName": "a" }, - "name": "a" + "name": "a", + "extra": {} }, "consequent": { "type": "BlockStatement", @@ -84,4 +85,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/test/fixtures/lightscript/whitespace/jsx-expression-bad-indent/expected.json b/test/fixtures/lightscript/whitespace/jsx-expression-bad-indent/expected.json index cc54d87bd5..662197003b 100644 --- a/test/fixtures/lightscript/whitespace/jsx-expression-bad-indent/expected.json +++ b/test/fixtures/lightscript/whitespace/jsx-expression-bad-indent/expected.json @@ -135,7 +135,10 @@ "column": 2 } }, - "extra": null, + "extra": { + "rawValue": "\n ", + "raw": "\n " + }, "value": "\n " }, { @@ -231,7 +234,10 @@ "column": 1 } }, - "extra": null, + "extra": { + "rawValue": "\n ", + "raw": "\n " + }, "value": "\n " } ] @@ -250,7 +256,10 @@ "column": 2 } }, - "extra": null, + "extra": { + "rawValue": "\n ", + "raw": "\n " + }, "value": "\n " }, { @@ -302,7 +311,10 @@ "column": 0 } }, - "extra": null, + "extra": { + "rawValue": "\n", + "raw": "\n" + }, "value": "\n" } ] diff --git a/test/fixtures/lightscript/whitespace/jsx-expression-indents/expected.json b/test/fixtures/lightscript/whitespace/jsx-expression-indents/expected.json index d27a371da1..9d3243fccc 100644 --- a/test/fixtures/lightscript/whitespace/jsx-expression-indents/expected.json +++ b/test/fixtures/lightscript/whitespace/jsx-expression-indents/expected.json @@ -135,7 +135,10 @@ "column": 2 } }, - "extra": null, + "extra": { + "rawValue": "\n ", + "raw": "\n " + }, "value": "\n " }, { @@ -180,6 +183,7 @@ "column": 22 } }, + "await": false, "left": { "type": "VariableDeclaration", "start": 13, @@ -351,7 +355,10 @@ "column": 0 } }, - "extra": null, + "extra": { + "rawValue": "\n", + "raw": "\n" + }, "value": "\n" } ] 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/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json b/test/fixtures/test262/rest-parameter/array-pattern-empty/expected.json similarity index 55% rename from test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json rename to test/fixtures/test262/rest-parameter/array-pattern-empty/expected.json index a5588e4e19..8fce044f0d 100644 --- a/test/fixtures/esprima/es2015-yield/.invalid-yield-generator-parameter/expected.json +++ b/test/fixtures/test262/rest-parameter/array-pattern-empty/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 20, + "end": 24, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 20 + "column": 24 } }, "program": { "type": "Program", "start": 0, - "end": 20, + "end": 24, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 20 + "column": 24 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "FunctionDeclaration", "start": 0, - "end": 20, + "end": 24, "loc": { "start": { "line": 1, @@ -39,62 +39,81 @@ }, "end": { "line": 1, - "column": 20 + "column": 24 } }, "id": { "type": "Identifier", - "start": 10, - "end": 11, + "start": 9, + "end": 14, "loc": { "start": { "line": 1, - "column": 10 + "column": 9 }, "end": { "line": 1, - "column": 11 - } + "column": 14 + }, + "identifierName": "empty" }, - "name": "g" + "name": "empty" }, - "generator": true, + "generator": false, "expression": false, + "async": false, "params": [ { - "type": "Identifier", - "start": 12, - "end": 17, + "type": "RestElement", + "start": 15, + "end": 20, "loc": { "start": { "line": 1, - "column": 12 + "column": 15 }, "end": { "line": 1, - "column": 17 + "column": 20 } }, - "name": "yield" + "argument": { + "type": "ArrayPattern", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "elements": [] + } } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, + "start": 22, + "end": 24, "loc": { "start": { "line": 1, - "column": 18 + "column": 22 }, "end": { "line": 1, - "column": 20 + "column": 24 } }, - "body": [] + "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/esprima/es2015-identifier/.invalid_function_wait/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-empty/expected.json similarity index 50% rename from test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json rename to test/fixtures/test262/rest-parameter/object-pattern-empty/expected.json index e1bd544880..38447d9767 100644 --- a/test/fixtures/esprima/es2015-identifier/.invalid_function_wait/expected.json +++ b/test/fixtures/test262/rest-parameter/object-pattern-empty/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 19, + "end": 24, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 19 + "column": 24 } }, "program": { "type": "Program", "start": 0, - "end": 19, + "end": 24, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 19 + "column": 24 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "FunctionDeclaration", "start": 0, - "end": 19, + "end": 24, "loc": { "start": { "line": 1, @@ -39,7 +39,7 @@ }, "end": { "line": 1, - "column": 19 + "column": 24 } }, "id": { @@ -54,30 +54,66 @@ "end": { "line": 1, "column": 14 - } + }, + "identifierName": "empty" }, - "name": "await" + "name": "empty" }, "generator": false, "expression": false, - "params": [], + "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": 17, - "end": 19, + "start": 22, + "end": 24, "loc": { "start": { "line": 1, - "column": 17 + "column": 22 }, "end": { "line": 1, - "column": 19 + "column": 24 } }, - "body": [] + "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/experimental/object-rest-spread/8/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-multi-element/expected.json similarity index 51% rename from test/fixtures/experimental/object-rest-spread/8/expected.json rename to test/fixtures/test262/rest-parameter/object-pattern-multi-element/expected.json index f97a0ab95c..b95a4b6234 100644 --- a/test/fixtures/experimental/object-rest-spread/8/expected.json +++ b/test/fixtures/test262/rest-parameter/object-pattern-multi-element/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 26, + "end": 47, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 26 + "column": 47 } }, "program": { "type": "Program", "start": 0, - "end": 26, + "end": 47, "loc": { "start": { "line": 1, @@ -23,15 +23,15 @@ }, "end": { "line": 1, - "column": 26 + "column": 47 } }, "sourceType": "script", "body": [ { - "type": "VariableDeclaration", + "type": "FunctionDeclaration", "start": 0, - "end": 26, + "end": 47, "loc": { "start": { "line": 1, @@ -39,203 +39,236 @@ }, "end": { "line": 1, - "column": 26 + "column": 47 } }, - "declarations": [ + "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": "VariableDeclarator", - "start": 4, - "end": 25, + "type": "RestElement", + "start": 22, + "end": 43, "loc": { "start": { "line": 1, - "column": 4 + "column": 22 }, "end": { "line": 1, - "column": 25 + "column": 43 } }, - "id": { + "argument": { "type": "ObjectPattern", - "start": 4, - "end": 19, + "start": 25, + "end": 43, "loc": { "start": { "line": 1, - "column": 4 + "column": 25 }, "end": { "line": 1, - "column": 19 + "column": 43 } }, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 7, + "start": 26, + "end": 30, "loc": { "start": { "line": 1, - "column": 6 + "column": 26 }, "end": { "line": 1, - "column": 7 + "column": 30 } }, "method": false, - "shorthand": true, + "shorthand": false, "computed": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, + "start": 26, + "end": 27, "loc": { "start": { "line": 1, - "column": 6 + "column": 26 }, "end": { "line": 1, - "column": 7 + "column": 27 }, - "identifierName": "x" + "identifierName": "a" }, - "name": "x" + "name": "a" }, "value": { "type": "Identifier", - "start": 6, - "end": 7, + "start": 29, + "end": 30, "loc": { "start": { "line": 1, - "column": 6 + "column": 29 }, "end": { "line": 1, - "column": 7 + "column": 30 }, - "identifierName": "x" + "identifierName": "r" }, - "name": "x" - }, - "extra": { - "shorthand": true + "name": "r" } }, { "type": "ObjectProperty", - "start": 9, - "end": 10, + "start": 32, + "end": 36, "loc": { "start": { "line": 1, - "column": 9 + "column": 32 }, "end": { "line": 1, - "column": 10 + "column": 36 } }, "method": false, - "shorthand": true, + "shorthand": false, "computed": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, + "start": 32, + "end": 33, "loc": { "start": { "line": 1, - "column": 9 + "column": 32 }, "end": { "line": 1, - "column": 10 + "column": 33 }, - "identifierName": "y" + "identifierName": "b" }, - "name": "y" + "name": "b" }, "value": { "type": "Identifier", - "start": 9, - "end": 10, + "start": 35, + "end": 36, "loc": { "start": { "line": 1, - "column": 9 + "column": 35 }, "end": { "line": 1, - "column": 10 + "column": 36 }, - "identifierName": "y" + "identifierName": "s" }, - "name": "y" - }, - "extra": { - "shorthand": true + "name": "s" } }, { - "type": "RestProperty", - "start": 12, - "end": 16, + "type": "ObjectProperty", + "start": 38, + "end": 42, "loc": { "start": { "line": 1, - "column": 12 + "column": 38 }, "end": { "line": 1, - "column": 16 + "column": 42 } }, - "argument": { + "method": false, + "shorthand": false, + "computed": false, + "key": { "type": "Identifier", - "start": 15, - "end": 16, + "start": 38, + "end": 39, "loc": { "start": { "line": 1, - "column": 15 + "column": 38 }, "end": { "line": 1, - "column": 16 + "column": 39 }, - "identifierName": "z" + "identifierName": "c" }, - "name": "z" + "name": "c" + }, + "value": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "t" + }, + "name": "t" } } ] - }, - "init": { - "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "obj" - }, - "name": "obj" } } ], - "kind": "let" + "body": { + "type": "BlockStatement", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [], + "directives": [] + } } ], "directives": [] 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/esprima/es2015-yield/.yield-generator-function-parameter/expected.json b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/expected.json similarity index 55% rename from test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json rename to test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/expected.json index e8b2f8224a..e9c4c2859a 100644 --- a/test/fixtures/esprima/es2015-yield/.yield-generator-function-parameter/expected.json +++ b/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/expected.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 44, + "end": 47, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 44 + "column": 47 } }, "program": { "type": "Program", "start": 0, - "end": 44, + "end": 47, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 44 + "column": 47 } }, "sourceType": "script", @@ -31,7 +31,7 @@ { "type": "FunctionDeclaration", "start": 0, - "end": 44, + "end": 47, "loc": { "start": { "line": 1, @@ -39,147 +39,151 @@ }, "end": { "line": 1, - "column": 44 + "column": 47 } }, "id": { "type": "Identifier", - "start": 10, - "end": 11, + "start": 9, + "end": 31, "loc": { "start": { "line": 1, - "column": 10 + "column": 9 }, "end": { "line": 1, - "column": 11 - } + "column": 31 + }, + "identifierName": "singleElementWithArray" }, - "name": "g" + "name": "singleElementWithArray" }, - "generator": true, + "generator": false, "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "start": 14, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 14 + "async": false, + "params": [ + { + "type": "RestElement", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } }, - "end": { - "line": 1, - "column": 44 - } - }, - "body": [ - { - "type": "VariableDeclaration", - "start": 16, - "end": 42, + "argument": { + "type": "ObjectPattern", + "start": 35, + "end": 43, "loc": { "start": { "line": 1, - "column": 16 + "column": 35 }, "end": { "line": 1, - "column": 42 + "column": 43 } }, - "declarations": [ + "properties": [ { - "type": "VariableDeclarator", - "start": 20, + "type": "ObjectProperty", + "start": 36, "end": 42, "loc": { "start": { "line": 1, - "column": 20 + "column": 36 }, "end": { "line": 1, "column": 42 } }, - "id": { + "method": false, + "shorthand": false, + "computed": false, + "key": { "type": "Identifier", - "start": 20, - "end": 21, + "start": 36, + "end": 37, "loc": { "start": { "line": 1, - "column": 20 + "column": 36 }, "end": { "line": 1, - "column": 21 - } + "column": 37 + }, + "identifierName": "p" }, - "name": "z" + "name": "p" }, - "init": { - "type": "FunctionExpression", - "start": 24, + "value": { + "type": "ArrayPattern", + "start": 39, "end": 42, "loc": { "start": { "line": 1, - "column": 24 + "column": 39 }, "end": { "line": 1, "column": 42 } }, - "id": null, - "generator": false, - "expression": false, - "params": [ + "elements": [ { "type": "Identifier", - "start": 33, - "end": 38, + "start": 40, + "end": 41, "loc": { "start": { "line": 1, - "column": 33 + "column": 40 }, "end": { "line": 1, - "column": 38 - } + "column": 41 + }, + "identifierName": "a" }, - "name": "yield" + "name": "a" } - ], - "body": { - "type": "BlockStatement", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, - "body": [] - } + ] } } - ], - "kind": "var" + ] + } + } + ], + "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 diff --git a/test/utils/runFixtureTests.js b/test/helpers/runFixtureTests.js similarity index 77% rename from test/utils/runFixtureTests.js rename to test/helpers/runFixtureTests.js index aa5268066b..7f4fe617f0 100644 --- a/test/utils/runFixtureTests.js +++ b/test/helpers/runFixtureTests.js @@ -1,15 +1,25 @@ -var test = require("ava"); -var getFixtures = require("babel-helper-fixtures").multiple; -var readFile = require("babel-helper-fixtures").readFile; -var resolve = require("try-resolve"); +import test from "ava"; +import { multiple as getFixtures } from "babel-helper-fixtures"; +import { readFile } from "babel-helper-fixtures"; +import resolve from "try-resolve"; +const stack = true; const only = { topic: null, suite: null, task: null, } +const allowUnexpectedKeys = { + "extra": true, + "skinny": true, + "isNowAssign": true, + "predicate": true, +} +const ignoreEntirelyKeys = { + "predicate": true, +} -exports.runFixtureTests = function runFixtureTests(fixturesPath, parseFunction) { +export function runFixtureTests(fixturesPath, parseFunction) { var fixtures = getFixtures(fixturesPath); Object.keys(fixtures).forEach(function (name) { @@ -20,12 +30,13 @@ exports.runFixtureTests = function runFixtureTests(fixturesPath, parseFunction) if (only.task && task.title.indexOf(only.task) < 0) return 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); } }); }); @@ -33,7 +44,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) { @@ -53,12 +64,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); } }); }); @@ -102,12 +114,13 @@ exports.runTestsWithLightScript = function runTestsWithLightScript(fixturesPath, delete task.options.throws; } - 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; + t.fail(err); } }); }); @@ -116,16 +129,22 @@ exports.runTestsWithLightScript = function runTestsWithLightScript(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; require("fs").writeFileSync(test.expect.loc, JSON.stringify(ast, null, " ")); RegExp.prototype.toJSON = toJSON; } +function saveLscExp(test, ast) { + // Ensure that RegExp are serialized as strings + const toJSON = RegExp.prototype.toJSON; + RegExp.prototype.toJSON = RegExp.prototype.toString; + const lscExpectedLoc = test.actual.loc.replace("actual.js", "expected.lightscript.json"); + require("fs").writeFileSync(lscExpectedLoc, JSON.stringify(ast, null, " ")); + + RegExp.prototype.toJSON = toJSON; +} function saveLscErr(test, msg) { const lscOptionsLoc = test.actual.loc.replace("actual.js", "options.lightscript.json"); require("fs").writeFileSync(lscOptionsLoc, JSON.stringify({ throws: msg }, null, " ")); @@ -133,8 +152,6 @@ function saveLscErr(test, msg) { 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."); @@ -147,14 +164,18 @@ function runTest(test, parseFunction) { if (err.message === opts.throws) { return; } else { + // saveLscErr(test, err.message); err.message = "Expected error message: " + opts.throws + ". Got error message: " + err.message; throw err; } } - // saveLscErr(test, err.message); + // saveLscErr(test, err.message) throw err; } + delete ast.tokens; + if (ast.comments && !ast.comments.length) delete ast.comments; + if (!test.expect.code && !opts.throws && !process.env.CI) { if (test.expect.loc.indexOf(".json") < 0) test.expect.loc += "on"; return save(test, ast); @@ -164,8 +185,9 @@ 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); + // saveLscExp(test, ast); throw new Error(mis); } } @@ -200,8 +222,19 @@ function misMatch(exp, act) { return ppJSON(exp) + " !== " + ppJSON(act); } else { for (var prop in exp) { + if (ignoreEntirelyKeys[prop]) continue; 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 && !allowUnexpectedKeys[prop]) { + return `Did not expect a property '${prop}'`; + } + } } } diff --git a/test/index.js b/test/index.js index 2e07daa41b..6195b3efd9 100644 --- a/test/index.js +++ b/test/index.js @@ -1,7 +1,6 @@ import path from "path"; -import { runFixtureTests, runTestsWithLightScript } from "./utils/runFixtureTests"; -import { parse, parseExpression } from "../lib"; +import { runFixtureTests, runTestsWithLightScript } from "./helpers/runFixtureTests"; +import { parse } from "../lib"; runFixtureTests(path.join(__dirname, "fixtures"), parse); runTestsWithLightScript(path.join(__dirname, "fixtures"), parse); -runFixtureTests(path.join(__dirname, "expressions"), parseExpression); diff --git a/yarn.lock b/yarn.lock index 35b98367ce..54ac8f3cb8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,9 +2,44 @@ # 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" + 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@^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: + "@ava/babel-plugin-throws-helper" "^2.0.0" + babel-plugin-espower "^2.3.2" + +"@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" @@ -16,17 +51,17 @@ 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" +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.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" @@ -61,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" @@ -79,8 +120,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" @@ -99,10 +140,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" @@ -147,187 +184,179 @@ 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" -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" -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" -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.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" "^3.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-truncate "^0.2.0" + cli-cursor "^2.1.0" + cli-spinners "^1.0.0" + cli-truncate "^1.0.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" + diff-match-patch "^1.0.0" + 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" + 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" is-generator-fn "^1.0.0" is-obj "^1.0.0" is-observable "^0.2.0" is-promise "^2.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" - 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" + mkdirp "^0.5.1" ms "^0.7.1" - object-assign "^4.0.1" - observable-to-promise "^0.4.0" + multimatch "^2.1.0" + observable-to-promise "^0.5.0" option-chain "^0.1.0" - package-hash "^1.1.0" - pkg-conf "^1.0.1" + package-hash "^2.0.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" + 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" 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" +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.18.0" - babel-polyfill "^6.16.0" - babel-register "^6.18.0" - babel-runtime "^6.9.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 "^5.0.5" + 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.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@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 "^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-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 "^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" @@ -339,178 +368,266 @@ babel-core@6, babel-core@^6.17.0, babel-core@^6.18.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" + 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@^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@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 "^6.8.0" - babel-runtime "^6.20.0" - babel-types "^6.21.0" + 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-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-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-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.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-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@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 "^6.18.0" - babel-runtime "^6.0.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" + 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-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-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-function-name "^6.18.0" - babel-runtime "^6.9.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@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-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-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-runtime "^6.0.0" - babel-traverse "^6.18.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-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-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-helper-bindify-decorators "^6.18.0" - 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-fixtures@^6.9.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-helper-fixtures/-/babel-helper-fixtures-6.20.0.tgz#b794c55077e4d5b969604a98cecad0068a7f16e8" +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-runtime "^6.20.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@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 "^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 "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-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-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-runtime "^6.0.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-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-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-runtime "^6.0.0" - babel-types "^6.18.0" + babel-types "7.0.0-alpha.3" -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-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-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-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-runtime "^6.9.0" - babel-types "^6.18.0" + 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" + dependencies: + 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" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.23.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-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-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: - 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-runtime "^6.22.0" + babel-types "^6.22.0" + lodash "^4.2.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-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-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-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-helpers@^6.16.0: - version "6.16.0" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3" +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-runtime "^6.0.0" - babel-template "^6.16.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-messages@^6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.8.0.tgz#bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9" +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-runtime "^6.0.0" + 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-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-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-template "^6.7.0" - babel-types "^6.7.2" + 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-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-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-runtime "^6.0.0" + babel-template "7.0.0-alpha.3" -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-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.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-plugin-espower@^2.3.1: +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.22.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: + babel-runtime "^6.22.0" + +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: @@ -522,490 +639,554 @@ babel-plugin-espower@^2.3.1: espurify "^1.6.0" estraverse "^4.1.1" -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-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.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.1.tgz#c12de0fc6fe42adfb16be56f1ad11e4a9782eca9" dependencies: - find-up "^1.1.2" - istanbul-lib-instrument "^1.4.2" - object-assign "^4.1.0" - test-exclude "^3.3.0" + find-up "^2.1.0" + istanbul-lib-instrument "^1.6.2" + test-exclude "^4.0.3" 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.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: + 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@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.16.2" - babel-plugin-syntax-async-generators "^6.5.0" - babel-runtime "^6.0.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: - 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" + 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-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.0.0" - babel-template "^6.8.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.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-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.18.0" - babel-plugin-syntax-class-properties "^6.8.0" - babel-runtime "^6.9.1" - babel-template "^6.15.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.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-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-define-map "^6.8.0" - babel-helper-explode-class "^6.8.0" - babel-plugin-syntax-decorators "^6.13.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" - babel-types "^6.13.0" + babel-plugin-syntax-do-expressions "7.0.0-alpha.3" + +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-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-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-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-plugin-syntax-do-expressions "^6.8.0" - babel-runtime "^6.0.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-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-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.0.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-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-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-runtime "^6.0.0" + 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-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-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.20.0" - babel-template "^6.15.0" - babel-traverse "^6.21.0" - babel-types "^6.21.0" - lodash "^4.2.0" + babel-template "7.0.0-alpha.3" -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-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-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-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-helper-define-map "^6.8.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-runtime "^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-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.9.0" + babel-types "7.0.0-alpha.3" -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-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.0.0" - babel-types "^6.8.0" + babel-helper-function-name "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" -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-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-runtime "^6.0.0" + babel-helper-function-name "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^6.22.0" + +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-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-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-helper-function-name "^6.8.0" - babel-runtime "^6.9.0" - babel-types "^6.9.0" + babel-plugin-transform-es2015-modules-commonjs "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" -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-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-runtime "^6.0.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-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-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: - babel-plugin-transform-es2015-modules-commonjs "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.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-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-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-plugin-transform-strict-mode "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.16.0" - babel-types "^6.18.0" + babel-helper-hoist-variables "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" -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-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-helper-hoist-variables "^6.18.0" - babel-runtime "^6.11.6" - babel-template "^6.14.0" + babel-plugin-transform-es2015-modules-amd "7.0.0-alpha.3" + babel-template "7.0.0-alpha.3" -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-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-plugin-transform-es2015-modules-amd "^6.18.0" - babel-runtime "^6.0.0" - babel-template "^6.8.0" + babel-helper-replace-supers "7.0.0-alpha.3" -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-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-replace-supers "^6.8.0" - babel-runtime "^6.0.0" + 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.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: + 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@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.0.0" - babel-types "^6.18.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.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.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@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 "^6.8.0" - babel-runtime "^6.0.0" - babel-types "^6.8.0" + babel-helper-regex "7.0.0-alpha.3" + babel-types "7.0.0-alpha.3" -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-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-runtime "^6.0.0" + babel-helper-regex "^6.22.0" + babel-runtime "^6.22.0" + babel-types "^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-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@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.0.0" + babel-helper-regex "7.0.0-alpha.3" + regexpu-core "^4.0.2" -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: + 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.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@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.0.0" + babel-plugin-syntax-export-extensions "7.0.0-alpha.3" -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" +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.0.0" + babel-plugin-syntax-flow "7.0.0-alpha.3" -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@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.0.0" + babel-plugin-syntax-function-bind "7.0.0-alpha.3" -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@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.20.0" + babel-plugin-syntax-object-rest-spread "7.0.0-alpha.3" -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@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-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@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-runtime "^6.9.0" + babel-types "7.0.0-alpha.3" -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-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-helper-regex "^6.18.0" + babel-runtime "^6.23.0" + regexpu-core "^4.0.4" + +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-runtime "^6.20.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-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" - 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-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" - 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-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" - 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-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: + 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.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.18.0.tgz#892e2e03865078dd90ad2c715111ec4449b32a68" +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.18.0" - babel-runtime "^6.11.6" + 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@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-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-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: - babel-runtime "^6.9.0" - babel-traverse "^6.16.0" - babel-types "^6.16.0" - babylon "^6.11.0" + 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-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-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: - babel-code-frame "^6.20.0" - babel-messages "^6.8.0" - babel-runtime "^6.20.0" - babel-types "^6.21.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@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.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.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@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.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: - 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@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.16.1: + 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" @@ -1019,9 +1200,9 @@ block-stream@*: dependencies: 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" +bluebird@^3.0.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" boom@2.x.x: version "2.10.1" @@ -1029,18 +1210,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: @@ -1118,7 +1297,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" @@ -1126,13 +1305,17 @@ 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" -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" @@ -1159,7 +1342,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: @@ -1182,6 +1365,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" @@ -1190,22 +1377,28 @@ 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-truncate@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" +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@^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" @@ -1237,18 +1430,25 @@ 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" -codecov@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/codecov/-/codecov-1.0.1.tgz#97260ceac0e96b8eda8d562006558a53a139dffd" +color-convert@^1.0.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" dependencies: - argv ">=0.0.2" - execSync "1.0.2" - request ">=2.42.0" - urlgrey ">=0.4.0" + 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" @@ -1256,7 +1456,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: @@ -1274,7 +1474,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: @@ -1282,27 +1482,28 @@ concat-stream@^1.4.6: 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" 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.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" + 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" @@ -1319,25 +1520,25 @@ 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: 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@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-4.0.0.tgz#16083862d08275a4628b0b243b121bedaa55dd80" dependencies: - cross-spawn "^3.0.1" - lodash.assign "^3.2.0" + 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-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.1" - which "^1.2.9" + lru-cache "^4.0.0" + which "^1.2.8" cross-spawn@^4, cross-spawn@^4.0.0: version "4.0.2" @@ -1346,23 +1547,35 @@ cross-spawn@^4, cross-spawn@^4.0.0: lru-cache "^4.0.1" which "^1.2.9" +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: version "2.0.5" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" 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" 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" @@ -1379,17 +1592,11 @@ 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" -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" @@ -1438,28 +1645,30 @@ 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" +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" + +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" -dot-prop@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" +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" - -eastasianwidth@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.1.1.tgz#44d656de9da415694467335365fb3147b8572b7c" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" ecc-jsbn@~0.1.1: version "0.1.1" @@ -1474,63 +1683,71 @@ 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" + 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.15" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.15.tgz#c330a5934c1ee21284a7c081a86e5fd937c91ea6" 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-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" 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" @@ -1550,22 +1767,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.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.13.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.13.1.tgz#564d2646b5efded85df96985332edd91a23bff25" + 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" - 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" @@ -1603,23 +1821,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.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.1.tgz#28a83ab4aaed71ed8fe0f5efe61b76a05c13c4d2" dependencies: - acorn "^4.0.1" + acorn "^5.0.1" 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" @@ -1627,7 +1851,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" @@ -1643,18 +1867,35 @@ 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" - resolved "https://registry.yarnpkg.com/execSync/-/execSync-1.0.2.tgz#1f42eda582225180053224ecdd3fd1960fdb3139" +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" dependencies: - temp "~0.5.1" + 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" @@ -1690,13 +1931,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" @@ -1718,10 +1965,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" @@ -1737,6 +1980,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" @@ -1746,23 +1995,23 @@ 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.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" 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" @@ -1792,13 +2041,13 @@ 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" -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: @@ -1806,9 +2055,9 @@ fstream-ignore@~1.0.5: inherits "2" 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" +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: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -1816,8 +2065,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" @@ -1826,7 +2075,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: @@ -1843,16 +2091,25 @@ 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" 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" + +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" @@ -1872,16 +2129,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" @@ -1894,8 +2141,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.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" globby@^5.0.0: version "5.0.0" @@ -1918,34 +2165,26 @@ 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.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" @@ -1960,14 +2199,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" @@ -1991,6 +2232,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" @@ -2011,9 +2256,13 @@ 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.1.5" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" + 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" @@ -2023,13 +2272,31 @@ 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: +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" 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" @@ -2041,6 +2308,10 @@ indent-string@^2.1.0: dependencies: repeating "^2.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" + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -2075,8 +2346,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" @@ -2103,8 +2374,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" @@ -2166,9 +2437,13 @@ 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-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" dependencies: generate-function "^2.0.0" generate-object-property "^1.1.0" @@ -2245,7 +2520,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" @@ -2257,17 +2532,21 @@ 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" +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" -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" @@ -2279,78 +2558,137 @@ 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.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.0.tgz#24b4eb2b1d29d50f103b369bd422f6e640aa0777" +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" +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 "^19.0.0" + pretty-format "^19.0.0" + +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@^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 "^19.0.0" + +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-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: + 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 "^19.0.0" + +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" + graceful-fs "^4.1.6" + 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" 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" +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: 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" @@ -2374,7 +2712,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" @@ -2387,9 +2725,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" @@ -2406,19 +2745,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" @@ -2426,6 +2765,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" @@ -2433,7 +2776,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: @@ -2443,44 +2786,29 @@ 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" +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: - 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" + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" -lodash._createassigner@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz#838a5bae2fdaca63ac22dee8e19fa4e6d6970b11" +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" 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" + p-locate "^2.0.0" + path-exists "^3.0.0" -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" -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.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" @@ -2494,33 +2822,17 @@ 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.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.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" -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: +lodash.merge@^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" + 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" @@ -2547,7 +2859,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: @@ -2564,16 +2876,18 @@ 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" 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" @@ -2617,17 +2931,21 @@ 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" -"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: @@ -2641,16 +2959,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, ms@^0.7.1: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" @@ -2669,40 +2983,37 @@ 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.34" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.34.tgz#94ad1c798a11d7fc67381b50d47f8cc18d9799f7" 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" - -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" + 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" -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.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" @@ -2710,10 +3021,24 @@ 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@^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" + 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: @@ -2727,8 +3052,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" @@ -2740,12 +3065,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" @@ -2754,8 +3079,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: @@ -2773,29 +3098,29 @@ 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.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.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + 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" @@ -2834,7 +3159,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: version "0.1.4" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" dependencies: @@ -2849,17 +3174,40 @@ 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: 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: + 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 "^5.0.0" + got "^6.7.1" registry-auth-token "^3.0.1" registry-url "^3.0.3" semver "^5.1.0" @@ -2873,7 +3221,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: @@ -2893,6 +3241,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" @@ -2901,6 +3253,14 @@ 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" + path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" @@ -2913,6 +3273,16 @@ 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" + +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" @@ -2937,14 +3307,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" @@ -2966,53 +3334,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" @@ -3025,6 +3346,12 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" +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 "^3.0.0" + pretty-ms@^0.2.1: version "0.2.2" resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-0.2.2.tgz#da879a682ff33a37011046f13d627f67c73b84f6" @@ -3040,8 +3367,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" @@ -3059,9 +3386,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" @@ -3070,21 +3397,14 @@ 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.6" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" +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" minimist "^1.2.0" - strip-json-comments "~1.0.4" - -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" + strip-json-comments "~2.0.1" read-pkg-up@^1.0.1: version "1.0.1" @@ -3093,6 +3413,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" @@ -3101,21 +3428,17 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" 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" +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" 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" + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" -readable-stream@~2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" +"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: buffer-shims "^1.0.0" core-util-is "~1.0.0" @@ -3155,17 +3478,23 @@ 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" 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" - 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" @@ -3186,6 +3515,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" @@ -3202,12 +3542,32 @@ 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" + +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" + repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" @@ -3222,18 +3582,18 @@ repeating@^2.0.0: dependencies: 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" +request@^2.81.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" @@ -3241,10 +3601,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: @@ -3259,6 +3621,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" @@ -3284,9 +3650,11 @@ 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.6, resolve@^1.3.2: + 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" @@ -3295,24 +3663,25 @@ 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.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.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.1.4.tgz#5a6eb62eeda068f51ede50f29b3e5cd22f3d9bb2" - optionalDependencies: - graceful-fs "~1" - 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" @@ -3322,12 +3691,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: @@ -3337,9 +3707,15 @@ 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" + version "0.41.6" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" dependencies: source-map-support "^0.4.0" @@ -3353,13 +3729,17 @@ 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" 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" @@ -3371,9 +3751,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" @@ -3383,7 +3773,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" @@ -3405,17 +3795,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.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" @@ -3423,7 +3813,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" @@ -3457,8 +3847,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" @@ -3471,9 +3861,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" @@ -3494,14 +3884,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" @@ -3516,6 +3898,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" @@ -3526,29 +3914,25 @@ 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" -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: @@ -3558,9 +3942,9 @@ 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" +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" @@ -3573,20 +3957,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: @@ -3594,15 +3978,15 @@ 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" +term-size@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-0.1.1.tgz#87360b96396cab5760963714cda0d0cbeecad9ca" dependencies: - rimraf "~2.1.4" + execa "^0.4.0" -test-exclude@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-3.3.0.tgz#7a17ca1239988c98367b0621456dbb7d4bc38977" +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" @@ -3614,10 +3998,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" -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" @@ -3638,9 +4018,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" @@ -3652,15 +4032,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, try-resolve@^1.0.1: +try-resolve@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/try-resolve/-/try-resolve-1.0.1.tgz#cfde6fabd72d63e5797cfaab873abbe8e700e912" @@ -3668,9 +4047,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" @@ -3682,28 +4063,24 @@ 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" 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.21" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.21.tgz#1733f669ae6f82fc90c7b25ec0f5c783ee375314" dependencies: - async "~0.2.6" 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" @@ -3715,6 +4092,37 @@ 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-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" @@ -3723,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" @@ -3746,10 +4154,6 @@ url-parse-lax@^1.0.0: dependencies: prepend-http "^1.0.1" -urlgrey@>=0.4.0: - 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" @@ -3764,17 +4168,13 @@ 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" 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" @@ -3795,11 +4195,11 @@ 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: - version "1.2.12" - resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192" +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: - isexe "^1.1.1" + isexe "^2.0.0" wide-align@^1.1.0: version "1.1.0" @@ -3848,23 +4248,22 @@ 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.1.0" + resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-2.1.0.tgz#353aa44c39c48c21440f5c08ce6abd46141c9c08" dependencies: - write-json-file "^1.1.0" + sort-keys "^1.1.2" + write-json-file "^2.0.0" write@^0.2.1: version "0.2.1" @@ -3872,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" @@ -3887,18 +4284,24 @@ 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: +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" @@ -3912,7 +4315,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"